Create
cancel
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 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

0 votes

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

Suggest an answer

Log in or Sign up to answer
TAGS
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