I have Bitbucket 4.12.0 running fine without SSL. I've now put it behind an Nginx reverse proxy and followed the instructions. Here's my BITBUCKET_HOME/shared/bitbucket.properties server section:
server.port=7990
server.secure=true
server.scheme=https
server.proxy-port=443
server.redirect-port=443
server.proxy-name=my.domain.com
server.context-path=/
server.proxy-name matches that in the admin baseUrl settings.
The nginx config is this:
server {
listen 80;
server_name my.domain.com;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name my.domain.com;
ssl on;
ssl_certificate "/etc/certs/my.domain.com/fullchain.pem";
ssl_certificate_key "/etc/certs/my.domain.com/privkey.pem";
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
#ssl_ecdh_curve secp384r1;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
location / {
proxy_pass http://localhost:7990;
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;
proxy_redirect http://localhost:7990 https://my.domain.com;
# proxy_redirect off;
}
}Setting proxy_redirect off; causes a failure to subit forms on the site (as . The line that is in does not.
Despite all this, the BitBucket icon at top left still inks to http://localhost:7990 and I get the red banner at the top with the 'You are accessing Bitbucket from a URL that does not match the configured base URL. You may want to change it.' message.
The instructions are slightly confusing, as I was expecting to have to have a server.xml file, but replacing the bitbucket.properties with server.xml meant bitbucket wouldn't even start.
I can see that this sort of question has been asked before, but nothing I've seen so far has helped.
TIA