Apache ProxyPass ignore static files

Posted by virtualeyes on Server Fault See other posts from Server Fault or by virtualeyes
Published on 2012-04-15T16:11:45Z Indexed on 2012/04/15 17:33 UTC
Read the original article Hit count: 313

Having an issue with Apache front server connecting to a Jetty application server.

I thought that ProxyPass ! in a location block was supposed to NOT pass on processing to the application server, but for some reason that is not happening in my case, Jetty shows a 404 on the missing statics (js, css, etc.)

Here's my Apache (v 2.4, BTW) virtual host block:

DocumentRoot /path/to/foo
  ServerName foo.com
  ServerAdmin [email protected]

  RewriteEngine On

  <Directory /path/to/foo>
    AllowOverride  None
    Require all granted
  </Directory>

  ProxyRequests Off
  ProxyVia Off
  ProxyPreserveHost On

  <Proxy *>
    AddDefaultCharset off
    Order deny,allow
    Allow from all
  </Proxy>

  # don't pass through requests for statics (image,js,css, etc.)
  <Location /static/>
    ProxyPass !
  </Location>

  <Location />
    ProxyPass           http://localhost:8081/
    ProxyPassReverse    http://localhost:8081/
    SetEnv              proxy-sendchunks 1
  </Location>

© Server Fault or respective owner

Related posts about apache2

Related posts about jetty