Gitbucket Base URL behind mod_proxy SSL

Hello, I am running a latest Bitbucket server on an ubuntu server behind an apache with mod_proxy and an SSL certificate. I configured the connector of tomcat, that it works. Unfortunaly I get this message at the top of the frontend: Sie greifen auf Bitbucket von einer URL zu, die nicht mit der konfigurierten Basis-URL übereinstimmt. Sie haben die Möglichkeit das zu ändern .

 

In the backend there is the right base url defined. 

 

Can anyone help me please?

 

Thank you very much

 

1 answer

0 vote

Since you're terminating the SSL connection at the Apache server, Tomcat will receive the requests over HTTP. This HTTP vs HTTPS difference is most likely the cause of the base-url warning.

Make sure you have configured the secure, scheme, proxyName and proxyPort attributes on the Connector element in your server.xml as described in https://confluence.atlassian.com/display/BitbucketServer/Securing+Bitbucket+Server+with+Apache+using+SSL

 

That are my Connectors:

 

<Connector port="7990" protocol="HTTP/1.1"

                   connectionTimeout="20000"

                   useBodyEncodingForURI="true"

                   redirectPort="8443"

                   compression="on"

                   scheme="http"

                   proxyName="git.floriansturm-webdesign.de"

                   proxyPort="80"

                   compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript" />


<Connector port="8443"

                protocol="org.apache.coyote.http11.Http11NioProtocol"

                maxThreads="150"

                SSLEnabled="true"

                scheme="https"

                secure="true"

                clientAuth="false"

                sslProtocol="TLS"

                proxyName="git.floriansturm-webdesign.de"

 

                proxyPort="443" />



And this is my virtualhost:

VirtualHost *:443>

        ServerName git.floriansturm-webdesign.de

        SSLCertificateFile /etc/myssl/floriansturm-webdesign.de.crt

        SSLCertificateKeyFile /etc/myssl/privkey.pem

        ProxyPass / http://localhost:7990/

        ProxyPassReverse / http://localhost:7990/

 

</VirtualHost>

 

Is that right?

I think you're missing the secure="true" attribute and on the 7990 Connector. You also need to set the scheme attribute to https (instead of http)

anything else is correct? Im right, that I need these two connectors?

I changed it, but the message still appears:

 

<Connector port="7990" protocol="HTTP/1.1"

                   connectionTimeout="20000"

                   useBodyEncodingForURI="true"

                   redirectPort="8443"

                   compression="on"

                   scheme="https"

                   secure="true"

                   proxyName="git.floriansturm-webdesign.de"

                   proxyPort="80"

                   compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,$

 

  <Connector port="8443"

                protocol="org.apache.coyote.http11.Http11NioProtocol"

                maxThreads="150"

                SSLEnabled="true"

                scheme="https"

                secure="true"

                clientAuth="false"

                sslProtocol="TLS"

                proxyName="git.floriansturm-webdesign.de"

                proxyPort="443" />

did you restart Bitbucket after updating server.xml?

Yes, of course sad

 

Hi Florian,

ich habe das selbe Problem. Konntest du es inzwischen lösen?

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...

22,246 views 26 11
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