Forum Moderators: phranque
If I put in ProxyPass / [127.0.0.1:8080...] everything will get redirected to the application server. Since I do want the home page served by the application server whenever possible, the functional, but inelegant solution that I've come up with is to have two home pages - index.htm (served by the app server), and index.php (served only by Apache). index.php is served for /, and index.htm for /index.htm.
Is there a way to specify that / and only / (not the entire site) should be proxied?
The only solution I can think of is to set up directives to not proxy certain files and directories (using '!'), and then specifying ProxyPass / at the end of the declarations. But then I'd have to specify every directory and file in the root directory. I guess that's not horrible, but is there a way that's more elegant? And if I did that, how what should the ProxyPassReverse declarations look like?
<LocationMatch "/">
ProxyPass / [127.0.0.1:8080...]
ProxyPassReverse / [127.0.0.1:8080...]
</LocationMatch>
And got the following error when I tried to restart Apache:
Syntax error on line 311 of <filepath>: Invalid ProxyPass parameter. Parameter must be in the form 'key=value'
<LocationMatch "^/$">
Also, as stated in the ProxyPassReverse documentation [httpd.apache.org], you could use the [P] flag on a RewriteRule (see mod_rewrite) instead of ProxyPass to selectively proxy requests to your back-end server if the <Location> container isn't working for you.
Jim
[edited by: jdMorgan at 6:06 pm (utc) on Sep. 24, 2006]