# nginx csrf error on login

**URL:** <https://forum.ansible.com/t/nginx-csrf-error-on-login/35228>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [May 26, 2021, 6:16am UTC](https://forum.ansible.com/t/nginx-csrf-error-on-login/35228 "2021-05-26T06:16:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rene1](https://avatars.discourse-cdn.com/v4/letter/r/ecd19e/32.png) [@rene1](https://forum.ansible.com/u/rene1)\
**Post date:** [May 26, 2021, 6:16am UTC](https://forum.ansible.com/t/nginx-csrf-error-on-login/35228/1 "2021-05-26T06:16:28Z")

</div>

Hi,

does someone have a working nginx reverse config for 17.1.0 where the login works?

our setup would be nginx:8052 ssl → awx:nginx:8052 nossl

currently i tried this but i get the csrf token error 403 when i try to login:  
nginx:

location / {  
proxy\_pass [http://awxweb:8052/](http://awxweb:8052/);  
proxy\_http\_version 1.1;  
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-Port 8052;  
proxy\_set\_header Upgrade $http\_upgrade;  
proxy\_set\_header Connection “upgrade”;  
proxy\_cache\_bypass $http\_upgrade;  
proxy\_set\_header Accept-Encoding “”;  
proxy\_redirect off;  
}

awx:nginx:

location / {

# Add trailing / if missing

rewrite ^(._)$http\_host(._[^/])$ $1$http\_host$2/ permanent;  
uwsgi\_read\_timeout 120s;  
uwsgi\_pass uwsgi;  
include /etc/nginx/uwsgi\_params;  
proxy\_set\_header X-Forwarded-Port 8052;  
uwsgi\_param HTTP\_X\_FORWARDED\_PORT 8052;  
}

Thanks
