1

I have an internal app (Jira) that i want to use internally and externally, now there might be another way of doing this in which case i'm open to it, but this is what i have so far:

URL one: https://domainname.com/jira  - external domain name for it
URL two: https://domainname.local/jira - internal network name for it.

I am running Apache as a reverse proxy and I have this:

<Location /jira>
    ProxyPass http://127.0.0.1:8080/jira
    ProxyPassReverse http://127.0.0.1:8080/jira
</Location>

Jira creates all of its links using a base url, which in this case is set to 'https://domainname.local/jira', so obviously when pages get served to the outside world they have .local on them.

The question is, is there a way to have the content rewritten as it is served in order to change the .local addresses within the HTML to be the .com ones?

Is there an easier way to solve this?

Cheers for any help....

Andy

tgdavies
  • 10,307
  • 4
  • 35
  • 40
Andy
  • 1,421
  • 1
  • 16
  • 22
  • not entirely sure i understand your issue here... why can't you just connect to https://domainname.com/jira from internal network? – rytis Mar 23 '10 at 22:48
  • Dupe, see my answer at http://stackoverflow.com/questions/956361/apache-tomcat-using-mod-proxy-instead-of-ajp/962928#962928 . – Robert Munteanu Mar 23 '10 at 22:50
  • Not actually a dupe. Jira contains within it a base URL in this case https://domainname.local/jira. This is used to construct all URLs. So regardless of where it assumes it is hosting it from it will have these base URLs. I need to rewrite the content or rewrite Jira to take into account the server name it is being passed from. – Andy Mar 24 '10 at 09:22

3 Answers3

0

What about give a unique URL to JIRA? Your users may love this!

We use this with CNames, Apache's VirtualHosts, mod_jk to jira standalone edition and reverse proxies.

HIH!

0

My jira runs on local:84 and this is the setup to access it as jira.yourdomain.com:

#Jira
<VirtualHost *:80>
ServerName jira.yourdomain.com
ServerAlias jira.yourdomain.com

#jirafast?
ExpiresActive On
ExpiresDefault "access plus 300 seconds"
    ExpiresByType text/html "access plus 1 day"
    ExpiresByType text/css "access plus 1 day"
    ExpiresByType text/javascript "access plus 1 day"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
#jirafast? -


ProxyPreserveHost On
ProxyPass / http://localhost:84/
ProxyPassReverse / http://localhost:84/
<Proxy http://localhost:84/>
#  Order Allow,Deny
#  Allow from all
   Order Deny,Allow
   Allow from 127.0.0.1
</Proxy>
</VirtualHost>

If it is sub-optimal, don't be suprised, all I know is that it works

Mark Robbins
  • 2,427
  • 3
  • 24
  • 33
0

Jira will build URLs based on the URL used to access the server. In your case mod_proxy is using the proxy URL to connect.

You've got both domains proxying through to the local machine, which seems unnecessary given that the same web server is serving both domains. If you can, I'd cut out the Apache middle-man and configure both domains to point directly to Jira.

Having said that though, if you include ProxyPreserveHost On in your config, it will persist the hostname through to the server.

Mark McDonald
  • 7,571
  • 6
  • 46
  • 53