I have an OS X server running Apache, serving www.mydomain.be

I also have Jira running, standalone on www.mydomain.be:8080, and I would like to be able to access Jira via jira.mydomain.be.

In order to achieve this I added:

<IfModule mod_rewrite.c>
  RewriteCond %{HTTP_HOST} jira.mydomain.be
  RewriteRule ^/(.*)$ http://localhost:8080/$1 [P,QSA,L]
</IfModule>

When surfing to jira.mydomain.com it redirects me but doesn't use the proxy. That's why I get http://localhost:8080 in my address bar...

Suggestions?

I appended the above to the default site config under /etc/apache2/sites.

link|improve this question
Why don't you just put Jira into it's own virtual host jira.mydomain.be? – SvenW Jul 24 '11 at 10:22
feedback

2 Answers

<VirtualHost  *:80>
 ServerAdmin root@localhost
 DocumentRoot /var/www/html/
 ServerName jira.mydomain.be

 ProxyPreserveHost On
 ProxyPass / http://localhost:8080/
 ProxyPassReverse / http://localhost:8080/
</VirtualHost>
link|improve this answer
feedback

Don't use rewrite rules to proxy; just use the ProxyPass and ProxyPassReverse in a specific NameVirtualHost to proxy to the Jira instance.

Example off the top of my head:

<VirtualHost  *:80>
 ServerName jira.mydomain.be

 ProxyPass / http://localhost:8080/
 ProxyPassReverse / http://localhost:8080/
</VirtualHost>
link|improve this answer
can u give an example? – user88687 Jul 24 '11 at 10:40
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.