In ssl_default.conf where Apache serves as an SSL-adding proxy for Django Gunicorn, I have:

    Alias /admin/static/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/"

    ProxyPass /media/ !
    ProxyPass /admin/static/ !
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

What should I be doing differently to have /admin/static/* serving up the contents of the URL above? At present it appears to be handing requests, including /admin/static/*, to the Django Gunicorn process.


Now I'm getting a 403 after expanding:

    Alias /admin/static/ "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/"
    <Directory "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from ::1/128

This is on attempting to access /admin/static/css/base.css.


  • Check your error.log. It may be possible that the alias overlaps and therefore will never match; look for errors like The Alias directive in ... at line ... will probably never match because it overlaps an earlier Alias. – Martin von Wittich Jan 27 '14 at 18:41
  • I didn't see anything current in the error log; and Apache from the UI is not reporting an error, just handing the request to Django as would be appropriate if I weren't trying to alias a directory. – Christos Hayward Jan 27 '14 at 18:48
  • Could it be the trailing slash? stackoverflow.com/questions/13189261/… – Martin von Wittich Jan 27 '14 at 18:53
  • I'm not saying that I shouldn't change that, but I have only attempted to see it by adding a trailing slash. That is, I haven't attempted to access /admin/static, only /admin/static/*. – Christos Hayward Jan 27 '14 at 18:57
  • Breadcrumb note: I wrong "controb" for "contrib" in the Directory tab. However, fixing that did not seem to solve the problem. – Christos Hayward Jan 27 '14 at 21:02

Your Answer

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

Browse other questions tagged or ask your own question.