You can use a "try_files" directive - see http://wiki.nginx.org/NginxHttpMainModule#try_files.
Something like this might work:
[code]
location / {
index index.html; #probably redundant
try_files $uri $uri/ @django;
}
location @django {
proxy_pass http://127.0.0.1:8888;
proxy_redirect off;
....
}
[/code]
This requires a recent version of nginx (0.6.36+, 0.7.27+, 0.8.x). What this *should* do is that nginx will try the URI first. If it's a directory, it will look for an index file in that directory. If there are no matches if will pass to the backend.
--
Jim Ohlstein