Apache ProxyPass v RewriteRule

From MyWiki
Revision as of 19:56, 4 May 2015 by George2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

< source lang="text">

I just did this a week ago and it turned out to be really easy. There are two ways to do it in your httpd.conf file ...

<VirtualHost *:80> ServerName www.your-domain.com ProxyPreserveHost on ProxyPass /cp http://localhost:5678/cp ProxyPass /db/ http://localhost:5984/ </VirtualHost>

... or ...

<VirtualHost *:80> ServerName www.your-domain.com RewriteRule ^/(cp|db/|static/|www/)(.*)$ http://localhost:5678/$1$2 [P] <VirtualHost>

Google ProxyPass or RewriteRule for details.


</source>