3

I'm working on getting Apache to serve up static files for a Django project. My VirtualHost has:

Alias /static/ /home/jonathan/pragmatometer/static/

ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/

But requests for /static/css/style.css are being served by the Django process, not a static pull to /home/jonathan/pragmatometer/static/css/style.css.

What can I do so that the Alias trumps the proxy? I can try to cobble together several ProxyPass / ProxyPassReverse definitions for /load/, /save/, /admin/, but that has got to be the wrong way.

So what's the right way?

Christos Hayward
  • 1,162
  • 3
  • 16
  • 35

1 Answers1

9

Yes, ProxyPass wins in that case. The way to avoid this problem is:

ProxyPass /static/ !
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
Shane Madden
  • 114,520
  • 13
  • 181
  • 251