2👍
Thanks all – I’ve got it working, here’s my working testdev conf:
server {
root /<path-to-django-site>;
server_name testdev.com;
gzip off;
autoindex on;
proxy_set_header Host $host;
location /static/ {
add_header X-Static hit;
}
location / {
proxy_pass http://127.0.0.1:8000;
}
}
Looks like the location block takes the server root path if you don’t supply one. Now when I curl:
curl -I http://testdev.com/static/js/utils.js
HTTP/1.1 200 OK
Server: nginx/1.2.6
Date: Tue, 23 Apr 2013 01:36:07 GMT
Content-Type: application/x-javascript
Content-Length: 2730
Last-Modified: Thu, 13 Dec 2012 18:54:10 GMT
Connection: keep-alive
X-Static: hit
Accept-Ranges: bytes
Many thanks @Evgeny – got me on the right lines. Miget be useful for others looking to do the same.
Source:stackexchange.com