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 votes

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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

658 views 0 4
Read article

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot