this post was submitted on 16 Jul 2024
1 points (100.0% liked)

nginx

4 readers
1 users here now

The nginx community on Reddit. Reddit gives you the best of the internet in one place.

founded 1 year ago
MODERATORS
 
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?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here