I am running JIRA server 7.13.0 and trying to get a redirect to work from the server shortname to the FQDN without a proxy if possible
Right now users can go to:
https://jira or https://jira.FQDN.com
I want everyone on the FQDN so things work as they should with the base url.
I was reading about: https://confluence.atlassian.com/fishkb/how-do-i-redirect-http-requests-to-https-without-proxy-707724570.html
When playing in my lab environment I was not having much success using the urlrewrite. Has anyone had luck this way? Or are people using something like apache?
For confluence (running windows.. for now), I ended up using IIS and do not want to go that route.
Hey Mike,
I definitely get wanting to shy away from IIS. Apache and especially nginx aren't that bad though! They both run on Windows so you could go that route if you wanted before switching over to a Linux server.
After playing around with this a little in a test environment, I was able to get this working with Jira in Tomcat. All that was required was adding a rule to urlrewrite.xml which for Jira is located at:
<jira-install>/atlassian-jira/WEB-INF/urlrewrite.xml
Below the existing <rule></rule> section in the file, I added the following rule (make sure to update the FDQN to the proper value):
<rule>
<condition type="scheme" operator="equal">https</condition>
<condition name="host" operator="equal">jira</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://jira.FQDN.com/$1</to>
</rule>
Don't forget to restart Jira after making changes in this file to have them go into effect. And also - make sure you do this on a test environment first!
As mentioned in the documentation you linked to, doing this kind of change in your install directory won't persist across Jira upgrades. It's generally better to do this behind a reverse proxy so that it persists upgrades and is easier to troubleshoot. Pretty easy for this change to get lost in the Jira install path, whereas it's pretty simple to see an nginx config. Some food for thought as you move forward.
Cheers,
Daniel
Thanks Daniel - This leads me on the right track. Looks like I am getting ERR_TOO_MANY_REDIRECTS now but it is redirecting. Maybe something in my iptable rules is causing it
Edit: I put it on the default port and removed all iptable rules but still getting the too many redirects. Will continue troubleshooting. 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.
Thanks to your answers I figured out a way to redirect all names not matching the defined base URL.
<rule>
<condition type="scheme" operator="equal">https</condition>
<condition name="host" operator="notequal">jira.my-domain.local</condition>
<from>^/(.*)</from>
<to type="permanent-redirect" last="true">https://jira.my-domain.local/$1</to>
</rule>
This approach also avoids the ERR_TO_MANY_REDIRECTS.
In my server.xml short names coming via HTTP connector are redirected to HTTPS connector first. So this rule applies also to requests which used HTTP initially.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found that you also have to include the query string in the <to> line in order to capture all possible Jira links such as boards and filters, so like this:
<rule>
<condition type="scheme" operator="equal">https</condition>
<condition name="host" operator="notequal">jira.my-domain.local</condition>
<from>^/(.*)$</from>
<to type="permanent-redirect" last="true">https://jira.my-domain.local/$1?%{query-string}</to>
</rule>
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.