24 lines
705 B
Nginx Configuration File
24 lines
705 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name directlx.dev www.directlx.dev;
|
|
|
|
# Static files served directly by nginx
|
|
location /static {
|
|
alias /var/www/html/directlx.dev/static;
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Proxy all other requests to gunicorn
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_connect_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
}
|