Score:0

how to allow proxy pass with same location, with multiple context path

cn flag
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/*

Score:0
us flag

Your application generates the URLs in the output it creates. Therefore you need to configure your application to use a correct base URL so that the URLs it generates are correct.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.