The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

NGINX Reverse Proxy keeps giving 504 error

Luna
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 29, 2020

I tried to set up Bitbucket Server, and I successfully did. However, when I tried to put it behind an Nginx reverse proxy, I kept getting a 504 Gateway Time-out error.

My bitbucket.properties file:

server.port=7990
server.secure=true
server.scheme=https
server.proxy-name=code.example.com
server.context-path=/
server.proxy-port=443

My Nginx conf file:

server {
server_name code.example.com
listen 80;

location / {
proxy_pass http://localhost:7990;
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_set_header X-Real-IP $remote_addr;
proxy_redirect off;
}
}

Would anyone have any idea on how to fix this?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Christian Glockner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 1, 2020

Hi Luna,

My hunch is that nginx is being redirected by Bitbucket Server and thus fails.

Try changing the bitbucket.properties file as follows:

server.secure=false

server.scheme=http

server.proxy-port:80

This is based on the fact that there seems to be no SSL configuration in your nginx config and thus it won't listen on port 443.

Restart Bitbucket Server and see if that helps.

Cheers,

Christian

Premier Support Engineer

Atlassian

TAGS
AUG Leaders

Atlassian Community Events