I have the following VirtualHost configuration.

<VirtualHost *:80>
        ServerName myservername.website

        <Location />
                ProxyPass http://localhost:5000/
                ProxyPassReverse http://localhost:5000/

Currently there are a series of static files living in /var/www/static that the ProxyPass app is serving. I would rather that Apache served this.

I have no idea how to just say - "When a request to /static is received then serve it from /var/www/static on the filesystem". How do I do this?

2 Answers 2


You can use for example mod_rewrite


<VirtualHost *:80>
    ServerName myservername.website
    DocumentRoot /var/www/
    RewriteCond %{REQUEST_URI} !/static/
    RewriteRule (.*) http://localhost:5000/ [P]
Alias /static "/var/www/static"
<Directory "/var/www/static">
    Options FollowSymLinks
  • 1
    Also make sure that the user apache is running under has permission to read the files. Nov 12, 2015 at 18:04
  • Adding this to the VirtualHost did not work. Am I doing this wrong? Please note there are other VirtualHosts on the server and this should only affect one of them.
    – tgandrews
    Nov 13, 2015 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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