Apache ProxyPass v RewriteRule

From MyWiki
Jump to: navigation, search
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.