I\'m now deploying an django app with nginx and gunicorn on ubuntu 12.
And I configure the nginx virtual host file as below:
server {
listen 80;
You should use alias
instead of root
. root
appends the trailing URL parts to your local path (e.g. http://test.ndd/trailing/part, it will add /trailing/part to your local path). Instead of that, alias
does exactly what you want: when http://test.ndd/static/ is requested, /static is mapped to your alias exactly, without appending static again.