Please help, I am trying to set up a dynamic reverse proxy so that I won't require to make direct changes to nginx. What I want to achieve is to create a default locations say:
location ~ ^/staging/v1/(.*) {
resolver 4.2.2.2
proxy_pass https://$1$is_args$args;
}
so assuming that the Nginx reverse proxy server URL is example.com, and I visit example.com/staging/v1/test.com, the reverse proxy server will proxy my request to test.com with all the paths and arguments.
However, this seems to work with a lot of errors. First is that it loads blank page. but if I add the domain on the nginx location root like:
location / {
proxy_pass test.com;
}
this will make requests like example.com/staging/v1/test.com/app/login.png to start working.
Please I need help