Unable to change connector port for bitbucket 4.4.1

socialcom I'm New Here Dec 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

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

675 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