0

My Bitbucket instance is running in an Ubuntu server.

The initial installation was done by following the wizard and in that moment it was set the default port 7990.

Now I would like to change it to use the port 443, so as per the official documentation it can be easily done by changing the value server.port in the shared/bitbucket.properties file.

However, after that change, the server is not even listening in the new configured port.

Bitbucket is started as root user.

Why is bitbucket not taking into account the port modification?

Zumo de Vidrio
  • 2,021
  • 2
  • 15
  • 33

1 Answers1

0

Fixed after configuring a Nginx server which will do relay between port 7990 and 443.

Config bitbucket:

server.port=7990
server.proxy-name=******************
server.proxy-port=443
server.scheme=https
jdbc.url=jdbc\:postgresql\://localhost\:5432/bitbucket
jdbc.driver=org.postgresql.Driver
jdbc.user=******************
jdbc.password=*************

Config Nginx:

    server {
        location / {
            proxy_pass              http://localhost:7990;
                proxy_redirect          off;
                server_tokens           off;
            proxy_set_header        Host $host:$server_port;
                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        X-Real-IP $remote_addr;
        }
 }

server {
    listen       443 default ssl http2;
    server_name  ******************;

ssl_certificate "******************";
ssl_certificate_key "******************";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    client_max_body_size 0;

    location / {

            proxy_pass              http://localhost:7990;

            proxy_set_header Host $host:$server_port;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Proto https;

            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_redirect          off;

    }
}
Zumo de Vidrio
  • 2,021
  • 2
  • 15
  • 33