Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

URL Redirect WITHOUT Proxy

Paul Klassen April 13, 2018

I have the following issue...
A customer has a bitbucket server and moved to another domain this year.
Of coure he'd like to use a new subdomain for bitbucket.

let's say his old domain was old.red-company.com/bitbucket

and the new he'd like to use is new.blue-company.com

 

Although I changed and edited the configuration on the Proxy Server, the domain new.blue-company.com ALWAYS redirects me to old.red-company.com/bitbucket.
We also checked the Domain settings at their hoster because we though it might be a redirect there, but no, nothing.

Then I noticed that if I try to open bitbucket with <internalserverip>:7990/bitbucket

it is redirecting over and over again to old.red-company.com/bitbucket

I have no clue what this might be and I assume it's some kind of configuration on the bitbucket server itself. Any ideas or solutions for this?

3 answers

0 votes
Ergo Loorits
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2020

I'm experiencing the exact same issue right now

seems like something is cached somewhere even though all the configs and properties are set correctly as suggested in the docs

how to prevent this 302?

Ergo Loorits
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 29, 2020

I found my issue:

SERVER_PROXY_NAME environment variable was still set to old hostname (as I'm using Docker)

0 votes
Martin Liu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 27, 2019

Hi Paul,

You may need to check the file shared/server.xml or shared/bitbucket.properties

Martin

0 votes
Alexis Robert
Community Champion
April 13, 2018

Hello, 

 

can you check that you have correctly set the Base URL as shown here: https://confluence.atlassian.com/bitbucketserver/specifying-the-base-url-for-bitbucket-server-776640392.html

 

It should work fine if you have new.blue-company.com set here.

 

Let me know if it works, 

 

Cheers, 

 

 

-- Alexis

Paul Klassen April 16, 2018

Hi Alex,

thank you for your reply!

Yes, I already checked this an the new URL is already set there, but it still redirects to the old one.

Alexis Robert
Community Champion
April 16, 2018

Hi Paul, 

 

can you check with Chrome devtools what is happening in terms of redirections when you go to new.blue-company.com ? You can access this tool simply by Right-Click -> Inspect and then select Network tab and load new.blue-company.com

 

Cheers, 

 

--Alexis

Paul Klassen April 16, 2018

Hi Alexis,

sorry for misspelling your name in my first reply.

Since I don't use Chrome I tried this with Firefox.
I tried the the old address, the new and the IP of the Bitbucket Server itself, this is what I got.

When I access new.blue-company.com:
1. new.blue-company.com connects to the external IP of my reverse Proxy
2. reverse proxy answers with "Location: https://old.red-company.com/bitbucket/projects"

 

When I access old.red-company.com/bitbucket:
1. old.red-company.com/bitbucket connects to the external IP of my reverse Proxy
2. reverse proxy answers with "Location: https://old.red-company.com/bitbucket/"

When I access <internalIP>:7990/bitbucket:
1. <internalIP>:7990/bitbucket connects to the internal IP of the Bitbucket server itself
2. Bitbucket server answers with "Location: https://old.red-company.com/bitbucket/"


I hope this Info helps. If not, let me know what exactly you have to know.

Have a nice day,
Paul

Alexis Robert
Community Champion
April 17, 2018

Hi, 

 

do you see any specific HTTP code with the analysis tool ? something like HTTP 302 for example.

A test that you could do is change the Bitbucket base URL to the IP address and check that you're not redirected in this case.

 

Cheers, 

 

--Alexis

Paul Klassen April 17, 2018

Hi,

yes, I get in all three cases a 302 redirect.
I changed the base URL to the servers IP address, but still the same behavior with the old and new URL and also same with the servers IP address.

Alexis Robert
Community Champion
April 18, 2018

Hi, 

 

if you get 302 redirect then there is somewhere a configuration that forces  new.blue-company.com to redirect to old.red-company.com

Maybe something that was set up before you switched to this new domain, but I would advise to check with your IT team to find out. You will need to investigate this issue but I think Bitbucket is configured correctly so this is purely network related.

 

Cheers, 

 

--Alexis

Paul Klassen April 19, 2018

Hi Alexis,

there is a reverse Proxy and a AD Master Server which provides DNS.
I don't think it's a network issue because of the following reasons:

1. The reverse Proxy is configured correctly (we checked this multiple times)
2. There is no DNS Entry for the old domain on the AD Master Server
3. The NS Entries for the new domain are also correct since they point to the external IP of the reverse Proxy
4. The redirect also happens when the Bitbucket server is accessed directly via its internal IP and without using the reverse Proxy

The redirect somehow happens on the Bitbucket server itself, but I have no clue where and why.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events