django : Serving static files through nginx
I also struggled with this. However, following trick worked for me:
server { listen 8000; server_name localhost; access_log /var/log/nginx/aa8000.access.log; error_log /var/log/nginx/aa8000.error.log; location / { index index.html index.htm; } location ^/static/ { autoindex on; root /opt/aa/webroot/; } }
I just marked static as a regex with ^
and nginx started serving static files. No modification on Django side was needed.