mirror of
https://github.com/retspen/webvirtcloud
synced 2026-10-18 00:50:07 +00:00
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
This commit is contained in:
parent
7a9b3c9e13
commit
933e7b378a
2 changed files with 10 additions and 5 deletions
|
|
@ -12,10 +12,9 @@ server {
|
|||
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 $host:$server_port;
|
||||
proxy_set_header X-Forwarded-Proto http;
|
||||
proxy_set_header X-Forwarded-Ssl off;
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue