2
Views
1
Comments
[Reverse Proxy] Using nginx to translate https://myapp.com to https://OSserver/myapp

Hi.

I'm setting up a reverse proxy using nginx to translate:

https://pedrorito.av.it.pt

to

https://uda-dev.outsystemsenterprise.com/PedroRito

Here is my nginx config:

server {
server_name pedrorito.av.it.pt;

    location / {

        rewrite ^/(.*)$ /PedroRito/$1 break;

        proxy_pass https://uda-dev.outsystemsenterprise.com;
}

Still, it's not working properly, I get the message "There was an error processing your request."

You can test yourself.

Could you help me writing the right configuration for my use case?

Thank you.


Rank: #73172

I now have it working with the following configuration:

server {
server_name pedrorito.av.it.pt;

    location / {

            rewrite ^/$ /PedroRito break;

            proxy_pass https://uda-dev.outsystemsenterprise.com/;

            proxy_set_header Host $host;

    }

}

However, the URL in the browser is https://pedrorito.av.it.pt/PedroRito/ and I would like to have only https://pedrorito.av.it.pt/ . Is it possible?