I am trying to deploy a website with nginx and gunicorn. Nginx is serving static files and acting as a proxy to gunicorn.
Here is the content of my /etc/nginx/sites-available/herbop file
server {
listen 80;
server_name herbop.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_intercept_errors on;
proxy_pass http://127.0.0.1:8001;
}
location /static/ {
autoindex on;
alias /opt/Herbop-Backend/app/static/;
}
}
server {
listen 80;
server_name 51.254.123.234;
return 301 $scheme://herbop.com$request_uri;
}
In this case I seem to get an infinite redirection loop.
Any idea ?
The page isn't redirecting properly
herbop.com
and51.254.123.234
both point to your server?