Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Confluence-server (docker) + reverse nginx + cloudflare = 502 bad gateway

Cedric Walter
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 21, 2020

Hi All

Im struggling with this issue since a few hours... I keep getting "Bad gateway 502"

/etc/hosts

127.0.0.1 confluence

Nginx

server {
#ipv4
listen 80;
listen 443 ssl http2;
#ipv6
listen [::]:443 ssl http2;

server_name wiki.xxxxxx.xx;
proxy_read_timeout 600s;
location / {
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://confluence:8090;
client_max_body_size 50M;
}
}

Docker

docker run -e JVM_MINIMUM_MEMORY=2048m \
-e JVM_MAXIMUM_MEMORY=8192m \
-e ATL_PROXY_NAME=wiki.xxxxxx.xx \
-e ATL_PROXY_PORT=443 \
-e ATL_TOMCAT_SCHEME=https \
-e VIRTUAL_PORT=8090 \
-v /home/confluence:/var/atlassian/application-data/confluence \
--name="confluence" -d \
--network atlassian \
-p 8090:8090 -p 8091:8091 \
atlassian/confluence-server

Cloudflare

Running on free account, DNS is used beside CDN

Tested

  • DNS point to right server
  • ip address of wiki.xxxxxx.xx, https://ipadress:8090 let me access confluence (I did open firewall port 8090 on ipserver)

Any ideas what would be wrong?

 

1 answer

0 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 16, 2020

Hi Cedric,

Just curious if you'd sorted this out already or if it's still throwing 502 errors.

I did see something interesting between your test and configuration:

https://ipadress:8090 let me access confluence

Not sure if that was a typo, but you've told nginx that it should forward requests to Confluence over HTTP, but if it's working with the address you mentioned, that means Confluence is serving HTTPS over that port instead. This would throw a protocol mismatch at nginx, and result in a 502.

If you're still stuck and that was in fact a typo (or you're seeing something else now), please let me know and we can work together to troubleshoot!

Cheers,
Daniel

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events