How to Reverse proxy for nginx configuration for subpath in ROOT folder?

I have two servers with different IP addresses:

Nginx is running on port 443, and I’m using it to reverse proxy my webapp this way:

    location /app1/ {
    rewrite ^/app1(.*) /$1 break; 
    proxy_pass;  }

This way, I normally access my webapp via nginx through https://

Secondly, in the ROOT folder of my webapp, I installed the birt-viewer application in the ROOT/birt-viewer folder. I normally access the birt-viewer application when I use the link https://

However, I don’t normally access the birt application when I use the link https:// when I copy for example the link /birt-viewer/Task.jsp?__report=Recare.rpgn&sample=my+parameter&__sessionId=2026 and I paste it after the link https:// to obtain the final link https://, I access the birt-viewer application but I lose settings such as cookies and sessions.

You understand that to access my webapp via nginx I have to do it manually; the disadvantage is the loss of cookies, sessions and other parameters. Yet access should be done automatically without problems.

This is a part of my nginx config:

    location /app1/ {
     rewrite ^/app1(.*) /$1 break; 
     proxy_pass https://;  }
 location /app1/folder1/ {
 rewrite ^/app1/folder1(.*) /$1 break; 
 proxy_pass https://;  }

I also realize that once my webapp behind nginx, some urls are not up to date and still keep the old access.

So my concern is to access the birt-viewer application automatically (not manually) through nginx via https://

Does anyone have a solution for me?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer