Configure static files to work with NGINX

Nope, not what I said at all.

There are two separate and independent operations going on here.

  1. Nginx receives a request for a url starting with /static/. Because it’s associated with a root directive, nginx attempts to open the associated file and return it to the requesting device.

  2. Nginx receives a request for something else. Because it’s associated with a proxy_pass directive, it forwards the request itself through the defined socket to whatever is listening on the other end (in this case, gunicorn). Nginx itself makes no attempt to access any file associated with what is listening to the socket.

Nginx needs no rights to any file that is part of the application.

What I wrote:

That’s all.

1 Like