0

My Goal

My goal is to redirect to a different web page without changing the URL in the address bar. So for example I want to redirect from https://my.site.com/path to https://external.com/other, but only the content of the page should change, not the URL.

Current configuration

This is what I have tried. I thought, that proxy_redirect might be a good idea, so I based the configuration on the NGINX docs. But while this does load the content of https://external.com/other, the URL in the address bar changes to https://my.site.com/other. The domain name stays the same, but the path changes.

location = /path {
    proxy_pass https://external.com/other;
    proxy_redirect default;
}
  • Does this answer your question? [How can I forward requests from my web server?](https://serverfault.com/questions/1035016/how-can-i-forward-requests-from-my-web-server) – Gerald Schneider Sep 16 '21 at 11:33
  • @GeraldSchneider No, that doesn't answer my question. I'm basically doing what the answer suggests, but I don't want the path in the URL to change, when making a request. I want it to stay the same, while only the content of the site changes. – Andy Sukowski-Bang Sep 16 '21 at 11:45
  • No, you are not doing it. What you want is not a redirect, it's a plain reverse proxy. – Gerald Schneider Sep 16 '21 at 12:23
  • Chances are that the redirect you are still getting from the backend server, which needs to be configured properly. – Gerald Schneider Sep 16 '21 at 12:41

0 Answers0