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?

| improve this question | | | | |
9

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

ProxyPass /static/ !
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
| improve this answer | | | | |

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.