server {
listen 80;
server_name example.com www.example.com;
location /consol {
if ($request_method !~ ^(GET|POST)$) {
return 405 "Not allowed";
}
set $consolalb alb.backend;
proxy_pass http://$consolalb/workspace/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Custom-Forwarded-Proto $http_x_forwarded_proto;
proxy_cache_bypass $http_upgrade;
}
}
I have the scenario where the user request reaches our ngnix container reverse proxy. www.example.com/consol and it has to forward to backend alb (e.g alb.backend) and the alb is mapped to oracle hyperion application server with the context path /workspace.
with the above configuration I can able to load the initial login page /workspace/index.jsp, along with that getting additional pop ups with different context paths getting error like page not found. those page not found urls look like www.example.com/interop, www.example.com/mypage.jsp etc. all the popups are having page not found error.
I need some suggetion how to forward www.example.com/consol incoming user request to http://$consolalb/workspace/; for the first time and subsequent pop request to http://$consolalb/*