Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a setup where my Tomcat instances are fronted with Apache servers with mod-proxy. I need to serve static content on the reverse-proxy side in case authentication closes my app session (heavy ajax app).

The idea is the browser is requesting some static content such as:

http://myreverseproxy.com/app/sc/skins/Enterprise/images/SectionHeader/opener_closed.png

Apache forwards the request to Tomcat who will serve the image. I need it to be served by Apache, is this possible?

thx!

share|improve this question

1 Answer 1

Yes very much possible.

For example:

<VirtualHost *:80>
  ServerName yourdomain.tld
  ServerAlias www.yourdomain.tld *.yourdomain.tld  
  DocumentRoot /path/to/your/website/document/root

ProxyPass /images !
ProxyPass /assets !

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/

    <Proxy http://localhost:8080/*>
       Allow from all
    </Proxy>

</VirtualHost>

I am considering tomcat server is running under port 8080 in your lo interface. Basically above configuration will proxy everythings to tomcat server except for yourdomain.tld/images and assets folder which will be directly served by the apache.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.