1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-10-18 09:00:07 +00:00
webvirtcloud/conf/nginx/webvirtcloud.conf
catborise 933e7b378a fix(security): resolve CSRF 403 on DEBUG=False and improve reverse proxy headers
- Add local ports and env var fallback for CSRF_TRUSTED_ORIGINS in settings.py.template
- Configure SECURE_PROXY_SSL_HEADER for reverse proxy / HTTPS environments
- Update Nginx proxy headers to use $http_host and $scheme to prevent port mismatch
2026-09-25 10:28:49 +03:00

49 lines
1.3 KiB
Text

server {
listen 80;
#server_name webvirtcloud.example.com;
#access_log /var/log/nginx/webvirtcloud-access_log;
location /static/ {
root /srv/webvirtcloud;
expires max;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 1800;
proxy_read_timeout 1800;
proxy_send_timeout 1800;
client_max_body_size 1024M;
}
location /novncd/ {
proxy_pass http://wsnovncd;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /socket.io/ {
proxy_pass http://wssocketiod;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /websockify {
proxy_pass http://wsnovncd;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
upstream wsnovncd {
server 127.0.0.1:6080;
}
upstream wssocketiod {
server 127.0.0.1:6081;
}