Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to configure apache2 reverse proxy:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    <Proxy *>
        Order deny,allow
        Allow from all

    ProxyPass           /stag
    ProxyPassReverse    /stag

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from ::1/128


My Play instance run at localhost:9001, when I tried to call it success, and cannot load all the files (image, css, js) inside the public folder of play project when try to call When I check the url (using F12 on google Chrome) it comes to it supposed to

My question, is there a problem with my configuration of apache2 reverse proxy?

share|improve this question

Apache config is good, the a problem is in the contents of your HTML.

If your HTML points to the root..

<img src="/public/images/logo.png">

Then it points to the root, and the /stag prefix that your proxy is effectively adding is ignored. Your ProxyPass and ProxyPassReverse don't translate this for you.

On the other hand, if you allow the path to be relative..

<img src="public/images/logo.png">

Then, the relative path is kept and the resource can load.

There's also tools like mod_proxy_html that attempt to translate the paths in your HTML files, but they aren't foolproof; the better option is to make the contents work within the proxy.

share|improve this answer
No different if change to public/images/logo.png. I'll try to store at Tomcat and reverse proxy the tomcat. – Crazenezz Jul 18 '12 at 4:19

Your Answer


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.