Difference between revisions of "Apache ProxyPass v RewriteRule"

From MyWiki
Jump to: navigation, search
(Created page with "< 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...")
 
 
Line 1: Line 1:
< source lang="text">
+
 
 +
<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 ...
 
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 ...

Latest revision as of 19:58, 4 May 2015

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.