Forum Moderators: phranque
ProxyPass /en-US ajp://localhost:50101/en-US
ProxyPass /en-CA ajp://localhost:50101/en-CA
# now proxy the remainder of traffic to the client's DC
ProxyPass / http://www1.example.ca/
ProxyPassReverse / http://www1.example.ca/
[/code]Any proxy experts? I am looking for the best to way to proxy specific content to localhost and the remainder (non-matching) content to another website. Are these configs equivalent?
so
[code]
ProxyPass /en-US ajp://localhost:50101/en-CA
ProxyPass /en-CA ajp://localhost:50101/en-US
ProxyPass /foo ajp://localhost:50101/foo
ProxyPass /test ajp://localhost:50101/test
# now proxy the remainder of traffic to the client's DC
ProxyPass / http://www1.example.ca/
ProxyPassReverse / http://www1.example.ca/
RewriteCond %{REQUEST_URI} !^/(en-CA|/en-US|/foo|/test)
RewriteRule ^/$ http://www1.example.ca [P]
!^/(en-CA|/en-US|/foo|/test) /en-CA //en-US //foo and //test RewriteRule ^/$ http://www1.example.ca [P] example.com// with a double slash.
RewriteCond %{REQUEST_URI} !^/(en-CA|en-US|foo|test)
RewriteRule ^/(.*) http://www1.example.ca [P]
/$1 on the end of the rule target if you want to pass the requested page name through. %{SERVER_PORT} for port 443 in one rule and for NOT port 443 in the other rule.
RewriteCond %{HTTPS} on RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !^/(en-CA|en-US|foo|test)
RewriteRule ^/(.*) http://www1.example.ca/$1 [P]
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{REQUEST_URI} !^/(en-CA|en-US|foo|test)
RewriteRule ^/(.*) https://www1.example.ca/$1 [P]