# Solução de problemas do erro "BAD CSRF" na configuração inicial do site?

**URL:** <https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059>\
**Category:** Self-hosting\
**Created:** [12 Setembro , 2018 17:23 UTC](https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059 "2018-09-12T17:23:19Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Lee\_Ars](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lee_ars/32/1597_2.png) [@Lee\_Ars](https://meta.discourse.org/u/Lee_Ars)\
**Post date:** [12 Setembro , 2018 21:06 UTC](https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059/7 "2018-09-12T21:06:37Z")

</div>

Right, and my first guess was to make sure `X-Forwarded-Proto` was being appended properly by the reverse proxy—and it is. That’s the annoying thing here—the configuration between [the working forum](https://discourse.bigdinosaur.org/) and the new one is identical.

And when I say “identical” I mean literally using the exact same processes and config files 😃 They’re both on the same server, so other than the nginx configuration file in `sites-available` they’re even using the exact same set of configuration files. Everything’s the exact same.

The nginx config is pretty short—hard for me to screw that up:

```plaintext
server {
	server_name [redacted];
	listen 8881;
	listen 8882 http2;

	sendfile on;

	location / {
		access_log off;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header Host $http_host;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto https;
		proxy_redirect off;
		proxy_pass http://localhost:7996;
	}
}

```

The only differences between it and the config for the working forum is the `server_name` directive and the port I’m passing to.

---

_[View the full topic](https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059)._
