Unable to change connector port for bitbucket 4.4.1

socialcom December 27, 2017

My team runs JIRA, Confluence and BitBucket on a CentOS 6.5 system. So far they accessed the applications via their individual ports (8080, 8090 & 7990 respectively).

I wanted to change that and secure the connections and so decided to use a proxy server (Nginx) in the front and apply SSL for it. Having followed the guides in the community, I successfully completed the proxy re-direct for JIRA & Confluence. However, I am unable to do the same for BitBucket.

I changed the server.xml file (adding in proxyName, proxyPort and scheme) in addition to adding the Context path. But the application is still accessible only via the older method (URL + port #).

To my surprise, changing the connector port had no effect whatsoever as well!

After changing the connector port from the default 7990 to 8990, the application still starts only on port 7990! Below are my connector and context properties.

        <Connector port="8990" protocol="HTTP/1.1"
                   maxThreads="150"
                   minSpareThreads="25"
                   maxHttpHeaderSize="8192"
                   acceptCount="100"
                   disableUploadTimeout="true"
                   connectionTimeout="20000"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   compression="on"
                   compressableMimeType="text/html,text/xml,text/plain,text/css,application/json,application/javascript,application/x-javascript"
                   proxyName="bitbucket.xyzcompany.com"
                   proxyPort="80"
                   scheme="http"/>

<Context path="/projects" docBase="${catalina.home}/atlassian-bitbucket" reloadable="false" useHttpOnly="true">
            <Manager pathname="" />
            <Valve className="org.apache.catalina.authenticator.FormAuthenticator"  securePagesWithPragma="false" />
         </Context>

 Here's the code from nginx properties.

server  {
        listen 80;
        server_name bitbucket.xyzcompany.com;
        location /jira {
                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_pass http://localhost:8080/jira;
                proxy_redirect off;
                proxy_set_header    X-Real-IP $remote_addr;
                client_max_body_size    20M;
                }
        location /confluence {
                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_pass http://localhost:8090/confluence;
                proxy_redirect off;
                proxy_set_header    X-Real-IP $remote_addr;
                client_max_body_size    20M;
                }
        location /projects {
                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 Host $host;
                proxy_pass http://localhost:8990/projects;
                proxy_redirect off;
                proxy_set_header    X-Real-IP $remote_addr;
                client_max_body_size    20M;
                #try_files $uri $uri/ =404;
                }
        }

 I understand the port has been hardcoded somewhere or something similar to it, but I just can't find where.

Any help would be much appreciated!

1 answer

0 votes
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 2, 2018

Hello @socialcom,

I wanted to change that and secure the connections and so decided to use a proxy server (Nginx) in the front and apply SSL for it. 

Please, refer Securing Bitbucket Server behind nginx using SSL for further information.

Kind regards,

Rafael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events