configuration django with nginx configuration django with nginx nginx nginx

configuration django with nginx


You seem to be going to the wrong URL. You've configured gunicorn to run on port 9000, but nginx is running as the reverse proxy on the default web port, which is the whole point of it. You should just be going to mysite.com; nginx will proxy the Django app to :9000 and serve the assets directly.


Your configuration with collectstatic will serve the static files through django, hence on http://:9000/static.

The most efficient way to serve the files on a different port is directly through nginx. You can have multiple server directives in nginx.conf, each with its own listen directive.

See the answer in https://serverfault.com/questions/242679/how-to-run-multiple-nginx-instances-on-different-port