Unable to change connector port for bitbucket 4.4.1

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 vote

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

27,837 views 26 12
Join discussion

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