Nginx uwsgi_pass not working with location set to anything besides /

Just getting started with Docker, Nginx, and uWSGI. I’ve got a flask app that works great when I define a location like this:

    location / {
        include uwsgi_params;
        uwsgi_pass flask:8080;
    }

… but I’d like to have multiple applications (some running Flask, some Django, some Node, etc) running at different locations, so I can do stuff like:

I was hoping to just do this:

    location /app1/ {
        include uwsgi_params;
        uwsgi_pass flask:8080;
    }

… but I get a 404 back from Flask & Nginx:

nginx    | xxx.xxx.xxx.x - - [18/Dec/2019:23:18:09 +0000] "GET /app3/ HTTP/2.0" 404 232 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15" "-"
flask    | [pid: 6|app: 0|req: 1/1] xxx.xxx.xxx.x () {38 vars in 602 bytes} [Wed Dec 18 23:18:09 2019] GET /app3/ => generated 232 bytes in 2 msecs (HTTP/2.0 404) 2 headers in 72 bytes (1 switches on core 0)

Here’s the success/200 I get when I use / for the location:

flask    | [pid: 10|app: 0|req: 2/3] xxx.xxx.xxx.x () {38 vars in 592 bytes} [Wed Dec 18 23:30:33 2019] GET / => generated 65 bytes in 0 msecs (HTTP/2.0 200) 2 headers in 79 bytes (1 switches on core 1)
nginx    | xxx.xxx.xxx.x - - [18/Dec/2019:23:30:33 +0000] "GET / HTTP/2.0" 200 65 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15" "-"

What am I missing?

Source: StackOverflow