2

I have a global proxypass rule in httpd.conf

rules at global level

ProxyPass /test/css http://myserver:7788/test/css
ProxyPassReverse /test/css http://myserver:7788/test/css

and I have a virtual host

Listen localhost:7788
NameVirtualHost localhost:7788
<VirtualHost localhost:7788>
    Alias /test/css/ "C:/jboss/server/default/deploy/test.ear/test-web-app.war/css/"
</VirtualHost>

I would like to disable all global proxypass rules applying in this virtual host? NoProxy doesn't seem to work.

(The reason I would like to do this is I have below global rules which create a 502 proxy loop if applied within this virtual host

#pass all requests to application server
ProxyPass        /test      http://localhost:8080/test
ProxyPassReverse /test      http://localhost:8080/test

)

What I'm trying to do is, serve all static content (like css) using apache, while still proxying all the rest of requests to the application server.

0

2 Answers 2

1

In the vhost, try something like this

<VirtualHost localhost:7788>
    ProxyPass /test/css !
    Alias /test/css/ "C:/jboss/server/default/deploy/test.ear/test-web-app.war/css/"
</VirtualHost>

The ! says to not proxy this path. Give it a try ... ?

You can also try ProxyRequests Off in your vhost configs.

0

Assuming I understand what you are trying to do, I would get rid of the proxy stuff and use a location or locationmatch block to catch requests for the css. I would place this in the main site config of apache.

I would guess you are either proxying or using a AJP connector to Jboss. Put that after your location block. You could place your proxy pass to jboss here. You would then set the document root of Apache to the top of your war directory. You probably want to keep your alias from your virtualhost also.

After a little futher thought, this may be simpler

put this in the main http.conf outside of any virtualhosts

Alias /test/css/ "C:/jboss/server/default/deploy/test.ear/test-web-app.war/css/" Order allow,deny Allow from all

I assume you are running this all (Jboss, apache) on the same server. Note you could change the path in the directory block to the test-web-app.war directory and add more aliases if you had other things you wanted Apache to serve.

You may want to adjust your Proxypass to Jboss also so you have one for any directories you want JBoss to handle.. It might work just to place it after the above directory block

2
  • I have tried Alias and it only works if I don't have ProxyPass (global rule for /test) in please. Seems to me that ProxyPass is automatically overriding any Alias rules. I need a global ProxyPass for jboss because, jboss needs to handle all requests for *.seam regardless of the directory. This global ProxyPass(/test) which encompasses the Alias(/test/css) seems to override when put in at the global level.
    – chinto
    Nov 11, 2009 at 1:52
  • Perhaps a ProxyPassMatch for the *.seam files would do what you need? httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassmatch
    – ml
    Nov 12, 2009 at 16:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .