Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: [RESOLVED] mod_proxy subfolder exclude isn't working |
|
Author |
|
weiminlee
Joined: 21 May 2014 Posts: 2
|
Posted: Wed 21 May '14 23:34 Post subject: [RESOLVED] mod_proxy subfolder exclude isn't working |
|
|
Hello,
I have installed 2.4.9 64-bit vc11 on Windows 2008R2 with mod_jk 1.2.39. I have mod_proxy and mod_proxy_http enabled. I have mod_jk to proxy Tomcat which is running Interwoven/Autonomy LiveSite Display Services.
I'm trying to proxy / to a subfolder in Tomcat, but I also need to exclude other folders from the proxy. I've tried all variations using the exclude(!) descriptor, but nothing seems to work. Below is my virtual host configuration.
Has anyone ever notice the proxy exclusion descriptor to not work?
<VirtualHost *:80>
ServerAdmin myemail
DocumentRoot "D:/Apache24/htdocs"
ServerName sitename.org
ServerAlias *.sitename.org
ErrorLog "logs/sitename.error.log"
CustomLog "logs/sitename.access.log" common
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /folder1/ http://127.0.0.1/html/siteroot/folder1/
ProxyPass /site-resources !
ProxyPass /site-assets !
ProxyPass / http://127.0.0.1/siteroot/
JkMount /* lsds_worker
</VirtualHost>
My access log show the following message with the above configuration...
srcIP - - [14/May/2014:08:30:05 -0700] "GET / HTTP/1.1" 502 379
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/ HTTP/1.1" 502 391
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/ HTTP/1.1" 502 403
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/ HTTP/1.1" 502 415
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 427
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 439
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 451
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 463
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 475
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 487
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 499
127.0.0.1 - - [14/May/2014:08:30:05 -0700] "GET /siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/siteroot/ HTTP/1.1" 502 511
...the above just keeps appending until the server runs out of threads and I reboot apache.
Last edited by weiminlee on Tue 27 May '14 18:42; edited 1 time in total |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 26 May '14 10:49 Post subject: |
|
|
The excludes need to be set before the other proxypass rules |
|
Back to top |
|
weiminlee
Joined: 21 May 2014 Posts: 2
|
Posted: Tue 27 May '14 18:41 Post subject: |
|
|
I was able to solve my requirement with the following...
<VirtualHost *:80>
ServerAdmin myemail
DocumentRoot "D:/Apache24/htdocs"
ServerName sitename.org
ServerAlias *.sitename.org
ErrorLog "logs/sitename.error.log"
CustomLog "logs/sitename.access.log" common
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine on
RewriteRule ^/html/sitename/(.*) /$1 [L,R]
RewriteRule ^/sitename/(.*) /$1 [L,R]
RewriteRule ^/$ /default.page [L,R]
ProxyPreserveHost On
ProxyPassMatch ^/(.*\.page)$ http://127.0.0.1:1776/sitename/$1
ProxyPassMatch ^/folder1/(.*\.html)$ http://127.0.0.1:1776/html/sitename/folder1/$1
JkMount /* lsds_worker
</VirtualHost> |
|
Back to top |
|
|
|
|
|
|