45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
upstream app_server {
|
|
server web:8000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name _;
|
|
|
|
# Write logs to the host-mounted folder so Promtail can scrape them
|
|
access_log /var/log/rad/nginx.access.log combined;
|
|
error_log /var/log/rad/nginx.error.log warn;
|
|
|
|
client_max_body_size 100M;
|
|
|
|
location /static/ {
|
|
alias /usr/src/app/static/;
|
|
expires 30d;
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
}
|
|
|
|
location /media {
|
|
alias /usr/src/app/media;
|
|
}
|
|
|
|
location /ws/ {
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_pass http://app_server;
|
|
}
|
|
|
|
location / {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Host $host;
|
|
proxy_redirect off;
|
|
proxy_buffering off;
|
|
proxy_pass http://app_server;
|
|
}
|
|
}
|