Bitbucket Server logo displays incorrect URL
Symptoms
The Bitbucket Server logo displays an incorrect URL while all other links are correct.
Cause
A. Your server.xml
is not properly configured (this issue usually occurs after upgrading Bitbucket Server version 4.x). After upgrading Bitbucket Server you need to manually reapply any previous customization in your previous server.xml
to your new server.xml.
B. Your proxy is not properly configured.
Resolution
A. Your server.xml
needs to be configured as described on the step "Update any custom configurations" of the Bitbucket Server upgrade guide document. Usually the parameters redirectPort , scheme , proxyName and proxyPort
are missing from your new server.xml
installation and a diff between the two server.xml
files (new against old installation) should show that. For specific instructions on how your server.xml
should be configured, please refer to the Proxy and secure Bitbucket which will contain your specific set up. Note that adding these parameters to server.xml
requires a restart on your instance before it takes effect.
B. Bitbucket Server uses the 'Host' HTTP header which is being sent via your proxy. From the discussion on this Answers post successfully updating the URL required this additional directive in the nginx configuration file (i.e. nginx.conf)
:
proxy_set_header Host $host;
For example, nginx.conf
:
server {
listen 443;
server_name mycompany.com;
ssl on;
ssl_certificate <path/to/your/certificate>;
ssl_certificate_key <path/to/your/certificate/key>;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Optional optimisation - please refer to http://nginx.org/en/docs/http/configuring_https_servers.html
# ssl_session_cache shared:SSL:10m;
location /bitbucket {
proxy_pass http://localhost:7990/bitbucket;
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_set_header Host $host;
proxy_redirect off;
}
}