I modified the base URL of my Stash instance to http://myserver.mydomain.com/stash, and have nginx redirecting. I also modified the Context path in server.xml to point to "/stash".
I can log in just fine and use Stash using http://myserver.mydomain.com/stash, but I noticed two issues: clicking on the Stash logo in the upper-left corner of the page tries to link to "http://localhost:7990". The other issue is linking to Jira and Confluence; they also believe Stash is at http://localhost:7990. Anyone else encounter this problem? Thanks!
Hi Jim,
Have you configured the server.xml to also include the proxy name/port?This is for apache, but the server.xml changes need to happy for nginx as well:
https://confluence.atlassian.com/display/STASH/Integrating+Stash+with+Apache+HTTP+Server
Cheers,
Charles
Yes, Charles - I did. I can log into Stash without problems. I also double-checked the base URL set for Stash, and that is correct as well. It seems the internal Stash application doesn't use the base URL setting, since I've also found that creating new project/repositories also has the same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jim,
In those instances Stash uses the 'Host' HTTP header which is being sent via your Nginx. Do you have some configuration on the proxy side that would result in that header being sent incorrectly?
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you get stuck, would it be possible for you to attach your nginx and server.xml files? Or sanitized snippets so we can take a looK?
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also found this link: https://confluence.atlassian.com/display/STASHKB/Moving+Stash+to+a+different+context+path
But it assumes http://localhost:7990/stash ... and that's not what I'm looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The snippet of my nginx config file:
location ^~ /jira {
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_pass http://localhost:8080;
}
location ^~ /confluence {
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_pass http://localhost:8090;
}
location ^~ /stash {
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_pass http://localhost:7990;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jim,
Thanks for that. I can't see the <Connector> node in your server.xml, so you might already have this (as mentioned in the Apache documentation):
<Connector ... proxyName="myserver.mydomain.com" proxyPort="80" />
Cheers,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jim,
You might also be interested in the following:
http://stackoverflow.com/questions/12847771/configure-nginx-with-proxy-pass
Note the setting of the Host http header:
proxy_set_header Host $host;
I hope that helps.
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Charles,
Thanks - Adding proxy_set_header Host $Host solved the problem. It was perplexing because Jira and Confluence do not require this setting in nginx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
I have almost similiar issue Jim was facing but It's with IIS reverse proxy.
I have bitbucket server 5.2 and changed the URL from https://myserver.mydomain.com to https://myserver.abc.mydomain.com.
It's working normally but when I am trying to create a new branch from the Jira cloud page, it redirected to old URL.
Checked:
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It resolved itself, might be it was using the cached and took four-five days to update but not sure where it stored.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Issue summarized here: https://confluence.atlassian.com/display/STASHKB/Stash+logo+displays+localhost
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.
Confirmed that adding:
proxy_set_header Host $host;
Fixed my issue with Stash + nginx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The snippet of my nginx config file:
location ^~ /jira {
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_pass http://localhost:8080;</em<>>
}
location ^~ /confluence {
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_pass http://localhost:8090;</em<>>
}
location ^~ /stash {
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_pass http://localhost:7990;</em<>>
}
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.