XSRF check failed - Confluence Docker behind Nginx-proxy with SSL
Asked by admin:

When request HTTPS-POST on rest api, it returns 403 XSRF check failed. How should I config it correctly.

I am trying to use confluence docker behind nginx-proxy with SSL. I cannot find a complete blog or post which guide step by step. I have tried with HTTP, everything works well after turning off collaborative Editing.

My current setting works well at HTTPS - GET. It can load create/update page and save the post. However it fails with HTTPS-POST on rest api.

Trial 1: current setting

![Screenshot 2019-05-03 at 4.57.33 PM.png](/t5/image/serverpage/image-id/53394iD05AEC618C10924D/image-size/large?v=v2&px=999 "Screenshot 2019-05-03 at 4.57.33 PM.png")

Result: most works well. it can edit and save page.  
except HTTP-POST /rest i.e. cannot insert image, cannot save draft.

Trial 2:

setting --env SCHEME and SECURE which are contribute to server.xml.

- CATALINA_CONNECTOR_SCHEME=https  
- CATALINA_CONNECTOR_SECURE=true

Result: everything returns 502

REFERENCE

Confluence Installation Guide {#toc-hId--1438509614}
----------------------------------------------------

<https://confluence.atlassian.com/doc/confluence-installation-guide-135681.html>

atlassian/confluence-server {#toc-hId-1049003219}
-------------------------------------------------

<https://hub.docker.com/r/atlassian/confluence-server>

Cross Site Request Forgery (CSRF) protection changes in Atlassian REST {#toc-hId--758451244}
--------------------------------------------------------------------------------------------

<https://confluence.atlassian.com/kb/cross-site-request-forgery-csrf-protection-changes-in-atlassian-rest-779294918.html?_ga=2.228715164.1845038987.1556781362-627796801.1556781362>

Running Confluence behind NGINX with SSL {#toc-hId-1729061589}
--------------------------------------------------------------

<https://confluence.atlassian.com/doc/running-confluence-behind-nginx-with-ssl-858772080.html>

Collaborative Editing Related

Possible Confluence and Synchrony Configurations {#toc-hId--78392874}
---------------------------------------------------------------------

<https://confluence.atlassian.com/conf613/possible-confluence-and-synchrony-configurations-964961556.html>

Administering Collaborative Editing {#toc-hId--1885847337}
----------------------------------------------------------

<https://confluence.atlassian.com/conf613/administering-collaborative-editing-964961548.html>

Troubleshooting Collaborative Editing {#toc-hId-601665496}
----------------------------------------------------------

<https://confluence.atlassian.com/doc/troubleshooting-collaborative-editing-858772087.html>

Collaborative Editing and Synchrony Troubleshooting {#toc-hId--1205788967}
--------------------------------------------------------------------------

<https://confluence.atlassian.com/confkb/collaborative-editing-and-synchrony-troubleshooting-858584399.html>


Answers:
author: Stephen Sifers
body: Hello Wayne,

Thank you for sending over very detailed notes, instructions, and screenshots for your issue. The key item I'm interested in is that you said you're able to have a GET call response but your POST calls fail now with a 502 response. This is telling us that you're able to respond with information but unable to pass information through your proxy. While I'm not adept with nginx, I have used reference material in the past to help others in similar situations. We do have a specific article which covers configuring nginx to proxy requests to Confluence. We would suggest reviewing this article to see if it helps with your Confluence instance accepting connections. You may find this article at [How to use NGINX to proxy requests for Confluence](https://confluence.atlassian.com/confkb/how-to-use-nginx-to-proxy-requests-for-confluence-313459790.html).

If you're still having the issue please do let us know and we will give a best effort to figure out what the cause might.

Regards,  
Stephen Sifers


Tags: atl-adm