Hi,
I am using CentOS 7 and attempting to install Bitbucket Server 5.15 behind nginx, however I cannot get this working correctly.
I have followed the official guide : https://confluence.atlassian.com/bitbucketserver/securing-bitbucket-server-behind-nginx-using-ssl-776640112.html but am still having issues.
I want to use the url 'bitbucket.intranet.com' and http to redirect to https. I used port 8060 on installation, not port 7990.
If I type 'https://bitbucket.intranet.com' into my browser, it directs to localhost:8060 and 'ERR_CONNECTION_REFUSED'. If I type 'https://bitbucket.intranet.com/dashboard' then in takes me to the dashboard, but I am getting a 'Base URL mismatch error', I have set the base URL to 'https://bitbucket.intranet.com'.
Any pointers as to where I am going wrong?
Thanks in advance.
My bitbucket.properites file
server.port=8060
server.secure=true
server.scheme=https
server.proxy-port=443
server.redirect-port=443
server.proxy-name=bitbucket.intranet.com
server.context-path=/
My /etc/nginx/nginx.conf file
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 0;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 443;
server_name bitbucket.intranet.com;
ssl on;
ssl_certificate /etc/ssl/certs/bitbucket-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/bitbucket-selfsigned.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# Optional optimisation - please refer to
# http://nginx.org/en/docs/http/configuring_https_servers.html
# ssl_session_cache shared:SSL:10m;
location / {
proxy_pass http://localhost:8060;
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 off;
}
}
}
I also have these firewall rules configured (which may be wrong)
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: ssh dhcpv6-client https http
ports: 80/tcp
protocols:
masquerade: no
forward-ports: port=80:proto=tcp:toport=8060:toaddr=
source-ports:
icmp-blocks:
rich rules: