Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Gitbucket Base URL behind mod_proxy SSL

Florian Sturm October 14, 2016

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
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 14, 2016

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

 

Florian Sturm October 14, 2016

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?

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 14, 2016

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)

Florian Sturm October 14, 2016

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

Florian Sturm
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2016

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" />

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 14, 2016

did you restart Bitbucket after updating server.xml?

Florian Sturm
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2016

Yes, of course sad

 

tino_schulze
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 6, 2016

Hi Florian,

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

florian_kraft
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 18, 2016

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events