-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Hi
I m struggling with nginx with docker setup, it keeps filing with csrf.
I looked at django documentation and added csrf_trusted_domain
It didn't work.
Really hoping I can get this fixed.
Here's my nginx confug that acts as a reverse, BTW I have removed nginx that was part of the original docker compose and directly connecting to the pm-app
Also renamed the container to match service name
proxy
location / { proxy_pass http://pm-app:8020; #proxy_pass http://pm-frontend:80/; proxy_set_header Host 127.0.0.1; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_http_version 1.1; client_max_body_size 100M; #proxy_cookie_path / "/; Secure"; #proxy_read_timeout 900; }
Snippet of .pm-env file
Django debug mode. In production off or False is recommended. # Value can be set to: True or False (true enables debug mode. false disables debug mode.) DEBUG=True ALLOWED_HOSTS='wealth.x.com,127.0.0.1' CSRF_TRUSTED_ORIGINS='https://wealth.x.com,127.0.0.1,http://127.0.0.1,wealth.x.com'
Here's the actual error msg
Forbidden (403)
CSRF verification failed. Request aborted.
Help
Reason given for failure:
Origin checking failed - https://wealth.x.com does not match any trusted origins.