The original post: /r/nginx by /u/musbur on 2024-07-16 19:15:14.

Hi all, I’m completely stumped by a configuration conundrum. I’m running a WSGI application under gunicorn on a UNIX socket and I’m trying to proxy to it but not from the root location. Problem is, all tutorials and documentation show only how to proxy the “/” location bot not others. I’ve pruned my nginx config down to this, which works:

server {
    include uwsgi_params;
    location / {
        proxy_pass http://unix:/run/gunicorn/test.sock;
    }
}

However, I don’t want the WSGI app to live at root but at /test. But when I replace location / by location /test or location /test/, I always get a 404 error (directly from nginx not from the WSGI app).

How is this done correctly?