One character decides whether the backend gets /app/page or /page.
location /app/ { proxy_pass http://127.0.0.1:3000; } # backend sees /app/page
location /app/ { proxy_pass http://127.0.0.1:3000/; } # backend sees /page
When proxy_pass has no URI part, nginx passes the original request path unchanged. When it has one, even a bare /, the part of the path that matched the location is replaced by it. That is the standard way to mount an app under a subpath. The rule is different inside regex locations, where a URI part is not allowed at all, and when variables are used in proxy_pass. Check what the backend receives by watching its access log while you request /app/page once with each variant, and reload nginx between the two tests.
Further reading: ngx_http_proxy_module: proxy_pass
Going deeper: Guide: fix a 502 Bad Gateway in Nginx Proxy Manager, with a checklist that finds the cause