[Answered ]-Nginx responds 404 for Django app but static files work

2πŸ‘

βœ…

The purpose of try_files is to test for the existence of a local file, and if none found perform a default action. In your case, that default action is to invoke the named location called @proxy. This is what you need:

location / {
    try_files $uri @proxy;
}
location @proxy {
    uwsgi_pass unix://srv/apps/_/server.sock;
    include uwsgi_params;
}

See this document for details.

πŸ‘€Richard Smith

Leave a comment