Update nginx
This commit is contained in:
parent
488bdfe3e2
commit
1178fba25d
@ -40,8 +40,8 @@ services:
|
||||
ports:
|
||||
- 8000:80
|
||||
volumes:
|
||||
- ./static:/var/www/static
|
||||
- ./media:/var/www/media
|
||||
- ./static:/usr/share/nginx/html/static
|
||||
- ./media:/usr/share/nginx/html/media
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
depends_on:
|
||||
- django
|
||||
|
17
nginx.conf
17
nginx.conf
@ -12,13 +12,18 @@ http {
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
|
||||
# Django
|
||||
location /static/ {
|
||||
alias /var/www/static/;
|
||||
location / {
|
||||
proxy_pass http://django:8000;
|
||||
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