Make nginx reverse proxy 302 redirects to a URI sub-folder instead of the root folder

view full story

http://superuser.com – I have a web server on my LAN with the URL and I am trying to access it from the internet with an nginx reverse proxy with a URL like https://domain.com/my/web/app. The difficulty I'm having is the local server 302 redirects the web client to a URI like /login.php, which get passed back to the external browser as https://domain.com/login.php instead of https://domain.com/my/web/app/login.php, which results in a 404 error because there's nothing at https://domain.com/login.php. I have tried many different options, including rewrite directives, and this is as close as I can g (HowTos)