Wrong Git Clone URL When Using Proxy
Symptoms
When accessing a repository, the Git clone URL (default URL) should use the Bitbucket Server URL (example: http://localhost:7990
):
git clone http://USER@127.0.0.1:7990/git/PROJECT/REPOSITORY.git
This is not the case when Bitbucket Server is behind a proxy.
Cause
The proxy is translating the URL to a local URL, so Bitbucket Server uses that address to show the clone URL.
Resolution
Bitbucket Server 5.0+
Configure the appropriate proxy settings (proxy-name
, proxy-port
, etc) in bitbucket.properties
as mentioned in Proxy and secure Bitbucket.
Bitbucket Server 4.x
Update the connector settings in
$BITBUCKET_HOME/shared/server.xml
file to reflect the proxy settings from: <Connector port="7990" protocol="HTTP/1.1"
connectionTimeout="20000"
useBodyEncodingForURI="true"
redirectPort="8443"
compression="on"
compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"/>
To:
<Connector port="7990" protocol="HTTP/1.1"
connectionTimeout="20000"
useBodyEncodingForURI="true"
redirectPort="8443"
compression="on"
proxyName="myproxy.company.com"
proxyPort="PORT_NUMBER"
compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"/>
Restart Bitbucket Server.
Last modified on May 3, 2019
Powered by Confluence and Scroll Viewport.