Greetings! Whenever I log into my Bitbucket instance behind an Apache reverse proxy for SSL, Bitbucket thinks I'm using the localhost:7990 URL, when I'm not (it says base URL does not match current URL). I'm using https://code.greem.me - Any help on this would be appreciated!
Currently I'm using an evaluation license, but I've sent in an open source request.
Some extra info:
SSL CA: Let's Encrypt - Wildcard SSL valid for *.greem.me
Bitbucket Server Version: 5.13.1
I can attach my VirtualHost if needed.
Hello @Michael Husted,
you should be able to simply update the Base URL in your BitBucket configuration as described here.
Let me know if this helps,
--Alexis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, still says it. Could it be because the reverse proxy is accessing localhost, so it thinks I am too? The Bitbucket header image directs me to localhost as well. It gives me localhost when I make a branch as well. (the part where it says to push code/whatever has localhost:7990 there instead of code.greem.me.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok so it might be because of your reverse proxy configuration, what does your vhost look like ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You just need to change these 2 lines:
ProxyPass / http://localhost:7990/
ProxyPassReverse / http://localhost:7990/
to the actual bitbucket server IP:
ProxyPass / http://10.0.0.X/
ProxyPassReverse / http://10.0.0.X/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry I edited the answer - it should be your bitbucket server IP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Changed it to my server's public-facing IP, that somewhat resolved the issue. Is there anyway I could redirect my raw IP:port -> my domain?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you mean like when you type 192.168.0.1:7990 it would redirect to mydomain.com ? I don't think that's possible unless you play with redirects, like this:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^12\.34\.56\.789$
RewriteRule ^(.*)$ http://www.domainname.com/$1 [L,R=301]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wouldn't I need to have apache listen on that port? Or could I make a RegEx for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alexis RobertThe primary issue I'm having is that it's showing the IP:Port when creating a new repository. Also the Bitbucket header has it too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evan,
The URL used in those links is the URL configured as the Base URL.
Additionally, did you set the reverse proxy information in bitbucket.properties?
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.
The base URL is https://code.greem.me, that's odd. What would I need to add to the properties file? I was looking into that earlier but couldn't find anything.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, it's always yelling at me that my Base URL is incorrect.
Screenshots:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evan,
You'll need to add just a few lines to bitbucket.properties as described in step 1 here:
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.
I needed to add
ProxyPreserveHost On
to my VirtualHost to fix it, and set my base url to non-HTTPS. It's working now, thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.