Bitbucket behind a remote proxy

Hi

I moved my bitbucket server behind a remote proxy. The server is reached with

www.ipj-engineering.de/bitbucket

In the bitbucket daministration I set the Base URL tho the address "http://www.ipj-engineering.de/bitbucket"

But If I access bitbucket somthing is wrong: the Address is changing to the internal address of the server (192.168.100.11:7990). Also the "BitBucket" button shows as a address the internal address.

With Jira and confluence all works fine.

 

1 answer

1 accepted

0 vote

Hi Peter,

Upon placing Bitbucket Server behind a proxy, you need to inform the application that is it behind a proxy so that it will address it's traffic accordingly.

If you are running Bitbucket 5.x+ you can accomplish this by adding the following variables to your $Bitbucket_Home/shared/bitbucket.properties file. You can find detailed instructions for using Nginx and
 HAProxy. Both of these guides show for ssl but you can simply use the below block instead of the bitbucket.properties block the documentation provides to maintain your non-ssl configuration.

server.port=7990
server.scheme=http
server.proxy-port=80
server.proxy-name=ipj-engineering.de
server.context-path=/bitbucket

If you are running a pre-5.0 version of Bitbucket you will need follow these guides for Apache, Nginx and HAProxy. In this case you will need to set the same variables but instead you will set them in the $Bitbucket_Home/shared/server.xml file as shown below.

<Connector port="7990" 
     protocol="HTTP/1.1"
     connectionTimeout="20000"
     useBodyEncodingForURI="true"
     redirectPort="80"
     compression="on"
     compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
     scheme="http"
     proxyName="ipj-engineering.de" 
     proxyPort="80" />
<Context path="/bitbucket"
docBase="${catalina.home}/atlassian-bitbucket"
reloadable="false"
useHttpOnly="true" />

Once you complete the appropriate configuration, you will need to restart Bitbucket and then simply re-set your baseUrl to ensure it takes effect. Administration > Server Settings, Enter your baseUrl of http://ipj-engineering.de/bitbucket and hit save.

Super working now

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,905 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you