Confluence not accessible with nginx reverse proxy
Asked by Nea Youngspace:

I've set up confluence as a docker on my Unraid machine and would like to make it accessible from the outside of my LAN Network by using a reverse proxy.

For that I use Nginx Reverse Proxy Manager, which worked out perfectly for all my applications so far.  

I set up my CNAME record in Cloudflare, which points to the A record of my domain, which points directly to my IP adress.

When I enter the domain (confluence.mydomain.tld) in Firefox I get an 502 (bad gateway) from Cloudflare, which should mean, that the redirection works fine, but the confluence docker is not responding to back.

I saw a thread with a similar issue to mine, but that config does not work for me.

<br />

Also while using this config, Confluence displays the following error on it's homepage:  

**Tomcat config is incorrect** The Tomcat server.xml has an incorrect configuration:

**scheme** should be 'http'  
**proxyName** should be '10.10.50.15'  
**proxyPort** should be '8090'  

In the attachments you can see my settings in confluence, nginx proxy manager as well as the confluence docker itself in unraid.

I think there's probably an issue between the proxy manager and confluence, so my guess is, that I have something misconfigured

![confluence custom paths.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/121543i50A62A82FD4726EB/image-size/large?v=v2&px=999 "confluence custom paths.PNG")![confluence path.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/121544i58C796A119B24E6E/image-size/large?v=v2&px=999 "confluence path.PNG")![confluence ssl settings.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/121545iFF16F1804D26CC90/image-size/large?v=v2&px=999 "confluence ssl settings.PNG")![Confluence Docker Settings.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/121546iD9536093E5530D46/image-size/large?v=v2&px=999 "Confluence Docker Settings.PNG")![Confluence Genral configuration.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/121547i9F04946D345ED8B8/image-size/large?v=v2&px=999 "Confluence Genral configuration.PNG")


Answers:
author: Ilya Sklemin
body: Guys, put this in Custom Nginx Configuration:

*** ** * ** ***

```
 location / {
client_max_body_size 100m;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.4:8090;
}
location /synchrony {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.4:8091/synchrony;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
```

*** ** * ** ***

Where 192.168.1.4 = your local ip of confluence instance.

Also:
> The cloudflare proxy does not actually follow the redirect nginx sends, which results in this error. You probably need to set the SSL/TLS encryption mode to `Full` or `Full (Strict)` or remove the additional CloudFlare proxy.


author: ?ystein Holvik Johnsen
body: Did you ever figure this one out? I'm also getting 502 errors when trying to use Nginx Proxy Manager with Confluence running on my local network.


Tags: confluence-server

server