Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

NGINX Reverse Proxy keeps giving 504 error

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 file:


My Nginx conf file:

server {
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

0 votes

Hi Luna,

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

Try changing the file as follows:



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.



Premier Support Engineer


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,755 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you