Update nginx
This commit is contained in:
parent
488bdfe3e2
commit
1178fba25d
@ -40,8 +40,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8000:80
|
- 8000:80
|
||||||
volumes:
|
volumes:
|
||||||
- ./static:/var/www/static
|
- ./static:/usr/share/nginx/html/static
|
||||||
- ./media:/var/www/media
|
- ./media:/usr/share/nginx/html/media
|
||||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||||
depends_on:
|
depends_on:
|
||||||
- django
|
- django
|
||||||
|
17
nginx.conf
17
nginx.conf
@ -12,13 +12,18 @@ http {
|
|||||||
|
|
||||||
location = /favicon.ico { access_log off; log_not_found off; }
|
location = /favicon.ico { access_log off; log_not_found off; }
|
||||||
|
|
||||||
# Django
|
location / {
|
||||||
location /static/ {
|
proxy_pass http://django:8000;
|
||||||
alias /var/www/static/;
|
proxy_set_header Host $host;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /media/ {
|
|
||||||
alias /var/www/media/;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user