Answer the question
In order to leave comments, you need to log in
Nginx + Gunicorn + Pyramid output static on port 8000 instead of 80, how to fix?
Good day to all!
Installed nginx, gunicorn, pyramid framework on vds.
nginx settings file (/etc/nginx/sites-available/default):
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
access_log /var/log/nginx/myproject.log;
location /static/ {
root /root/myproject/appname/appname;
expires 30d;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
href="http://127.0.0.1:8000/static/file.png"
, and in the second case href="http://[site_name].ru:8000/static/file.png"
. Before that, there was a Bottle Framework with the same nginx settings and everything worked fine. How to fix this situation? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question