You are accessing Bitbucket from a URL that does not match the configured base URL
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When accessing Bitbucket Server, a red banner appears at the top of the page with the following message:
You are accessing Bitbucket from a URL that does not match the configured base URL. You may want to change it.
Cause
There can be multiple causes that lead to this banner being displayed.
Cause #1
The configured Base URL is different than the URL being used to access Bitbucket Server.
Cause #2
A reverse proxy is being used in front of Bitbucket Server and Tomcat has not been properly configured to be aware of this proxy.
Solution
Cause #1
Update the Base URL to be the correct value at Administration >> Server settings >> Base URL
.
Cause #2
Configure the connector in Tomcat to have the proper proxy configuration. Follow the guides at Proxy and secure Bitbucket for detailed steps on how to configure this.
The steps to set additional connectors changes in Bitbucket versions 5 onwards:
Versions up to Bitbucket Server 5.0
The connector in $BITBUCKET_HOME/shared/server.xml
should have proxyName
and proxyPort
at a minimum, for example:
<Connector port="7990"
protocol="HTTP/1.1"
connectionTimeout="20000"
useBodyEncodingForURI="true"
redirectPort="443"
compression="on"
compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
secure="true"
scheme="https"
proxyName="bitbucket.company.com"
proxyPort="443" />
Bitbucket Server will need to be restarted for this change to take affect.
Bitbucket Server 5.0 onwards
As of Bitbucket Server 5.0, you can't configure any Tomcat connectors directly as the application runs on Spring Boot.
The usual server.xml
configuration has been replaced by properties that need to be configured on <Bitbucket Home directory>/shared/bitbucket.properties
. Similarly, you can't configure web.xml
.
Unless you've have added external DB details during Bitbucket installation, the bitbucket.properties
file is not created by default. Please create an empty file named bitbucket.properties
at <Bitbucket Home directory>/shared/
to add the required properties and restart Bitbucket for it to take effect.
Configure the connector in Tomcat to have the proper proxy configuration. Follow the guides at Proxy and secure Bitbucket for detailed steps on how to configure this. The connector in $BITBUCKET_HOME/shared/bitbucket.properties
should have server.proxy-name
and server.proxy-port
at a minimum, for example:
server.port=7990
server.secure=true
server.scheme=https
server.proxy-port=443
server.redirect-port=443
server.proxy-name=bitbucket.company.com