502 Bad Gateway nginx/1.14.0 (Ubuntu)

tychegroup January 17, 2022

Confluence shows Error 502 when opening the url.

I have a server for jira, one for confluence and one for the database.

port 80 configuration is used for jira and port 443 ssl for confluence.

the servers are ubuntu 18.04 updated to date and jira version 8.2.4.

 

my question is:

  1. Is there an update that is affecting?
  2. Does any update affect the permissions level?
  3. Did an update make a change to the configuration parameters?

 

confluence server configuration:

Error 502 confluence.png

2 answers

0 votes
Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

Hi @tychegroup 

Use the below Configuration and let me know it it works

server { 

     listen [::]:80; 

     listen 80; 

     server_name your-site.com www.your-site.com 

     location / { 

         return 301 https://$server_name$request_uri/wiki;

     } 

} 

  

server { 

     listen [::]:443 ssl http2;

     listen 443 ssl http2;

     server_name your-site.com;

     ssl_certificate /path/to/fullchain.pem;

     ssl_certificate_key /path/to/privkey.pem;

     

     location / { 

         return 301 https://$server_name$request_uri/wiki;

     }      

  

     location /wiki { 

        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://localhost:8090/wiki; 

} 

  

    location /synchrony { 

        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://localhost:8091/synchrony; 

        proxy_http_version 1.1; 

        proxy_set_header Upgrade $http_upgrade; 

        proxy_set_header Connection "Upgrade"; 

    } 

} 

Also, you may need to change the server.xml file context path to /wiki and add the below

secure="true" scheme="https" proxyName="your-site.com" proxyPort="443" 

Let me know if this works!!

Thanks,
Pramodh

tychegroup January 17, 2022

Hi @Pramodh M 

question, the port 8090 has to be open (listening) in the server?

Pramodh M
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

@tychegroup

Yes that should be open and nginx configuration is on same server where confluence is running

0 votes
Laura Holton _ACE Rotterdam_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

Hi @tychegroup 👋

Welcome to the Community! I've taken a look at this for you and found a couple of Confluence Support articles that may shed a bit more light...

I hope this helps but if you have any other questions just ask away 😃

All the best,

Laura

tychegroup January 17, 2022

Hi, Laura Holton

thanks for your answer.

the first link does not apply, apache has not been updated, check the update history and apache does not have any updates.

the second link I don't have any errors in the catalina.out.

In confluence server i have an error:

2022/01/17 17:56:43 [error] 1216#1216: *4803 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.x, server: confluence.mydomain.es, request: "GET /favicon.ico HTTP/1.1", upstream: "http://xx.xx.xx.xx:8090/favicon.ico", host: "confluence.mydomain.es", referrer: "https://confluence.mydomain.es/"

Suggest an answer

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

Atlassian Community Events