It was just an example, app1 or app2 may be any app, eg. zabbix or another web server.
I have left the basic config for troubleshooting, my proxy pass is just as per below:
location /jenkins {
proxy_pass http://jenkins:8080;
}
The very first GET is:
---
curl http://localhost:8123/jenkins
<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2Fjenkins'/><script>window.location.replace('/login?from=%2Fjenkins');</script></head><body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
</body></html>
---
which tells the browser to go to http://localhost/login?from=%2Fjenkins but it should be rewritten to http://localhost/jenkins/login?from=%2Fjenkins