# Discourse Integration Nextcloud bad csrf

**URL:** https://meta.discourse.org/t/discourse-integration-nextcloud-bad-csrf/215218
**Category:** Self-hosting
**Created:** [January 18, 2022, 12:44pm UTC](https://meta.discourse.org/t/discourse-integration-nextcloud-bad-csrf/215218 "2022-01-18T12:44:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![solarsimon](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@solarsimon](https://meta.discourse.org/u/solarsimon)
#### Post date: [January 18, 2022, 12:44pm UTC](https://meta.discourse.org/t/discourse-integration-nextcloud-bad-csrf/215218/1 "2022-01-18T12:44:37Z")

</div>

Hi there,

I am trying to get the Dashboard integration running in our Nextcloud (22.2.3)  
We used to have a discourse instance running on discourse.group where the connection worked fine.

Since we moved our discourse instance to self hosted, it does not work anymore.  
Now discourse is running on a hetzner server in a Docker container. Nothing else running on that server. The DNS is configured with an A-Record.  
For installation, i followed this guide: [https://linoxide.com/install-discourse-docker-container/](https://linoxide.com/install-discourse-docker-container/)

I have found a description of a solution. But don’t know what steps to do.  
Does anyone know how to solve that issue in my setup?

> [@Troubleshooting "BAD CSRF" error on initial site setup?](https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059/19):
>
> The other site was also on cloudflare but didn’t have caching enabled. The new site root has aggressive caching enabled via page rules, which would also apply to subfolders, hence the issue. Browser Cache TTL: a month, Always Online: On, Cache Level: Cache Everything, Edge Cache TTL: 2419200 seconds I also think following header is also critical. proxy\_set\_header X-Forwarded-Proto https;

> [@Troubleshooting "BAD CSRF" error on initial site setup?](https://meta.discourse.org/t/troubleshooting-bad-csrf-error-on-initial-site-setup/97059/17):
>
> For anyone else banging their head facing this issue. Please read below.
> 
> I was having similar issue. In my case we are behind Cloudflare, then Nginx and the setup was for a forum on subfolder.
> 
> Ultimately following combination worked.
> 
> - Disabling caching for the subfolder on Cloudflare
> - Following Nginx block
> 
> ```plaintext
> location /folder {
> proxy_ssl_server_name on;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header X-Forwarded-Proto https;
> proxy_pass http://localhost:1357/folder;
> }
> 
> ```

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [January 18, 2022, 1:38pm UTC](https://meta.discourse.org/t/discourse-integration-nextcloud-bad-csrf/215218/2 "2022-01-18T13:38:32Z")

</div>

Are you using Google Chrome? Chrome 97 introduced a bug which broke [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) SSO logins

[https://bugs.chromium.org/p/chromium/issues/detail?id=1286367](https://bugs.chromium.org/p/chromium/issues/detail?id=1286367)

We’ve added a workaround for the issue in the latest version of Discourse, so make sure you’re up-to-date. (our hosted discourse.group sites are up-to-date, so maybe that’s why things were working there)

---

<div class="post-metadata">

### Author: ![solarsimon](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@solarsimon](https://meta.discourse.org/u/solarsimon)
#### Post date: [January 18, 2022, 1:51pm UTC](https://meta.discourse.org/t/discourse-integration-nextcloud-bad-csrf/215218/3 "2022-01-18T13:51:42Z")

</div>

On my Desktop I tried the setup with Mozilla Firefox running on windows 8. Also tried with updated Brave on my Android 11.  
From my perspective nothing changed on the client side.

I see that content:

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/e/e/ee03e61e242d956f6f5604848b3cb7e06a51219c.png)

With Brave, nothing happens when I click “Genehmigen”  
With Mozilla Firefox I get this window

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/d/f/df87725dc3b67f2d30afe2c4da8a67cbf590f42b.png)  
So both lead nowhere.

With Brave on Android 11 I get the Bad CSRF Error
