Deploy Django static files with Apache/Gunicorn Deploy Django static files with Apache/Gunicorn apache apache

Deploy Django static files with Apache/Gunicorn


I think the exclusion for for ProxyPass /static/ ! should come before ProxyPass /

ProxyPass /static/ !ProxyPass / http://localhost:9000/Alias /static/ /var/www/media/myapp/static/

Otherwise the static request will be sent to gunicorn, which will return a 404.

The ProxyPass documentation says:

The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins.