# Safe-mode returns \["BAD CSRF"\] with reverse proxy

**URL:** https://meta.discourse.org/t/safe-mode-returns-bad-csrf-with-reverse-proxy/174210
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [December 24, 2020, 4:42pm UTC](https://meta.discourse.org/t/safe-mode-returns-bad-csrf-with-reverse-proxy/174210 "2020-12-24T16:42:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 24, 2020, 4:42pm UTC](https://meta.discourse.org/t/safe-mode-returns-bad-csrf-with-reverse-proxy/174210/1 "2020-12-24T16:42:41Z")

</div>

I’m helping debug an AWS installation that’s working fine on the current production site.

For Reasons, they want to have an additional NGINX as a reverse proxy to handle some redirections. When the NGINX is added SSO logins don’t work; it as if the login didn’t happen.

When trying [safe mode](https://meta.discourse.org/t/53504?silent=true), I get a `BAD CSRF` after submitting the request to enable [safe mode](https://meta.discourse.org/t/53504?silent=true).

I’m not sure if this might be part of the problem we’re trying to solve, but it definitely seems like a problem.

I’m not sure where to look next.

EDIT: Here’s this:

> [@Troubleshooting "BAD CSRF" error on initial site setup?](https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059/5):
>
> This happens when SSL is badly configured. Most of the times a header is missing from the reverse proxy config.
