I can access bitbucket through my the web interface by going to the reverse proxied address git.domain.com. When I do, it asks for my login, and then upon successful login, I am redirected to http://localhost:7990.
Then (since I am an admin) I see a warning in the upper right corner that there is a "Base URL mismatch", but when I go to set the base URL, it is already set to git.domain.com.
Finally, when I go to create a new repository and get its URL to clone it for the first time, I see http://localhost:7990/<....>/project.git in the URL instead of the base URL http://git.domain.com/<...>/project.git.
I would guess this all stems from the same issue, but even through searching all of the answers online, I cannot figure out a solution to this problem!
How do I stop it from referencing http://localhost:7990 even when the base URL is configured?
Also, I am not using SSL and do not plan to at this time.
For reference, this is what my reverse proxy nginx script looks like:
server {
server_name git.domain.com;
listen 80;
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;
client_max_body_size 10M;
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
}
}
Hi Michael,
You'll need to add
server.proxy-port=80
server.proxy-name=git.company.com
to bitbucket.properties and restart Bitbucket Server.
Cheers,
Christian
Premier Support Engineer
Atlassian
Thank goodness! That was all it took and now it works.
For anyone else looking, my bitbucket.properties file was not in the same location as my bitbucket installation on CentOS 7. The installation is in the /opt/atlassian/bitbucket directory, whereas this properties file is in /var/atlassian/application-data/bitbucket (in the shared directory).
These are instructions I have been unable find online in all my google searches for "Install bitbucket behind nginx reverse proxy," with various combinations of including my operating system and bitbucket server version.
Can you point me to where I should have found these installation steps to correctly configure this installation behind the reverse proxy?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
The title of this article is perhaps a bit misleading, because it applies regardless of whether you use SSL or not:
Cheers,
Christian
Premier Support Engineer
Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. I now recall even looking at this article, but I was unable to make the leap between using port 443/TCP for SSL and 80/TCP for standard HTTP in the properties file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.