Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

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

2 Answers 2

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

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

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>
share|improve this answer
    
can u give an example? –  user88687 Jul 24 '11 at 10:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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