Update nginx.conf

This commit is contained in:
Andros Fenollosa 2024-05-11 12:59:09 +02:00 committed by GitHub
parent 8e4dbd522d
commit 967d7fd4c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,33 +1,33 @@
events {} events {}
http { http {
server { server {
listen 80 default_server; listen 80 default_server;
server_name _; server_name _;
root /var/www;
location / {
location / { proxy_pass http://django:8000;
proxy_pass http://django:8000; proxy_set_header Host $host;
proxy_set_header Host $host; proxy_http_version 1.1;
proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr; proxy_redirect off;
proxy_redirect off; }
}
location /static {
location /static { include /etc/nginx/mime.types;
autoindex on; alias /var/www/static;
} }
location /media { location /media {
autoindex on; alias /var/www/media;
} }
location = /favicon.ico { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; }
} }
} }