Forums

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

JIRA 4.4 with ProxyPass/ProxyPassReverse

JDeLong March 16, 2012

Just upgraded today from 3.13 to 4.4 and my redirect is now broken...if anyone else with a similar setup has some advice I would really appreciate it. This same config was working fine with 3.13...

<VirtualHost *:80>
ServerName jira.MYDOMAIN.org
ProxyRequests Off
ProxyPreserveHost On
ProxyPassReverseCookiePath / /jira/

ProxyPass /jira/ http://SERVER.MYDOMAIN.org/jira/
ProxyPassReverse /jira/ http://SERVER.MYDOMAIN.org/jira/
ProxyPass / http://SERVER.MYDOMAIN.org/jira/secure/Dashboard.jspa
ProxyPassReverse / http://SERVER.MYDOMAIN.org/jira/secure/Dashboard.jspa

</VirtualHost>

Overview is Apache instance running on a seperate server using http-vhosts. DNS alias pointing jira.MYDOMAIN.org to IP address of Apache host server. Basically pointing jira.MYDOMAIN.org to SERVER.MYDOMAIN.org/jira. It ends up turing the URL into this...

HTTP Status 404 - /jira/secure/Dashboard.jspajira

 

Let me know if you need any other info...this is quickly becoming a big problem...

 

Thanks in advance,

Jeff

2 answers

1 accepted

0 votes
Answer accepted
JDeLong March 16, 2012

Fixed with the help of a coworker (aka Apache Ninja)

<VirtualHost *:80>
ServerName http://jira.MYDOMAIN.org
ProxyRequests Off
ProxyPreserveHost On
ProxyPassReverseCookiePath / /jira/
ProxyPass /jira http://SERVER.MYDOMAIN.org/jira
ProxyPassReverse /jira http://SERVER.MYDOMAIN.org/jira
ProxyPass /index.html http://SERVER.MYDOMAIN.org/jira/secure/Dashboard.jspa
ProxyPassReverse /index.html http://SERVER.MYDOMAIN.org/jira/secure/Dashboard.jspa
</VirtualHost
>

Either way thank you for all of the help!

0 votes
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2012
Hi Jeffrey, please follow the instructions at http://confluence.atlassian.com/display/JIRA/Integrating+JIRA+with+Apache to configure Apache as reverse proxy. Especially note the red warnings about Jira 4
JDeLong March 16, 2012

I have tried backing it off to the point of seeing the errors relating to base URL vs requested URL...but what I am reporting is happening before the login even completes. I cannot figure out why the redirect is adding the extra context path to the end of the URL. I am sure there is some tie in here with the warnings about 4.0 and up. and what I am seeing...I just dont understand what that might be.

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2012
If your backend returns the URL .../jira in a redirection response it's rewritten by the third rule to what you encountered. The second rule does not match Since this would just match /jira/... if you just want the mapping jira.mydomain.org => server.nbme.org/jira you should only have the rule / => http://server.nbme.org/jira/ for both ProxyPass and ProxyPassReverse
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2012
You should also make sure your base url is set to http://jira.mydomain.org
JDeLong March 16, 2012

If I understand you correctly...I should be using this...

<VirtualHost *:80>
ServerName jira.MYDOMAIN.org
ProxyRequests Off
ProxyPreserveHost On
ProxyPassReverseCookiePath / /jira/

ProxyPass / http://SERVER.MYDOMAIN.org/jira/
ProxyPassReverse / http://SERVER.MYDOMAIN.org/jira/


</VirtualHost
>

With a base URL of http://jira.MYDOMAIN.org

This seems go give me the correct URL in the browser...but the login page will not load when accessed via http://jira.MYDOMAIN.org. Gives two errors on Dashboard.jspa...'AJS' and 'AG' undefined.

JDeLong March 16, 2012

This suggestion isn't working either...it disables the login gadget. Something of note...with my current config if I click the "Login" link in the upper right hand corner that works fine. No matter what the URL is in the browser at the time of clicking "Log In" button the URL directs to http://jira.MYDOMAIN.org/jira and displays the 404 error showing this path /jira/secure/Dashboard.jspajira

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2012
I am not sure if the rule ProxyPassReverseCookiePath is necessary,at least never have seen this in configurations. Please try it without that. You might also add another ProxyPassReverse rule for the without slash at the end: ProxyPassReverse / http://SERVER.MYDOMAIN.org/jira third you should check server.xml. To make 100% sure the base url matches the request url you should set proxyName="jira.mydomain.com" and proxyPort="80"
JDeLong March 16, 2012

I do not have my JIRA instance defined anywhere within my server.xml...I use a jira.xml in conf/Catalina/localhost to define context. Is this where I would definte the proxyName? Sorry for the silly questions...

JDeLong March 16, 2012

With this I get the dashboard but the gadgets fail with the same additional 'jira' added to the URL

<VirtualHost *:80>
ServerName http://jira.MYDOMAIN.org
ProxyRequests Off
ProxyPreserveHost On


ProxyPass / http://SERVERNAME.MYDOMAIN.org/jira/secure/Dashboard.jspa
ProxyPassReverse / http://SERVERNAME.MYDOMAIN.org/jira/secure/Dashboard.jspa

</VirtualHost
>

/jira/secure/Dashboard.jspajira/plugins/servlet/gadgets/ifr

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2012
Please read the link http://confluence.atlassian.com/display/JIRA/Integrating+JIRA+with+Apache and search for proxyName to get the right place. This setting is connector specific, not application specific and thus jira.xml would be the wrong place
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 16, 2012
I have also found an example closer to your configuration at http://confluence.atlassian.com/display/DOC/Using+Apache+with+mod_proxy it's for confluence but that should work for Jira as well. There is a little difference in the ProxyPass und ProxyPassReverse rule: the backend URL is without / at the end so you should try this also. Sorry for this try and error play but i also have never mapped jira.xxx.com to server.xxx.com/jira, just have experience with mapping server1.xxx.com/jira to server2.xxx.com/jira so actually i'm learning here too.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events