<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size:
15px; clear: both; color: rgb(36, 39, 41); font-family: Arial,
"Helvetica Neue", Helvetica, sans-serif; font-style:
normal; font-variant-ligatures: normal; font-variant-caps: normal;
font-weight: normal; letter-spacing: normal; orphans: 2;
text-align: left; text-indent: 0px; text-transform: none;
white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
255);">I have an NGINX as reverse proxy with PHP-fpm. Nginx is set
up for serving <a class="moz-txt-link-abbreviated" href="http://www.somehost.com">www.somehost.com</a>. I added another host
<a class="moz-txt-link-abbreviated" href="http://www.anotherhost.com">www.anotherhost.com</a>. Now I need to setup redirect in this way: If
user type <a class="moz-txt-link-abbreviated" href="http://www.anotherhost.com">www.anotherhost.com</a> then it redirects to
<a class="moz-txt-link-abbreviated" href="http://www.somehost.com/someurl">www.somehost.com/someurl</a>, but url in browser bar shouldn't change.
If I set up rewrite it works, but it rewrites url in browser too.</p>
<pre style="margin: 0px 0px 1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); word-wrap: normal; color: rgb(36, 39, 41); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><code style="margin: 0px; padding: 0px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: inherit;">if ($host = "<a class="moz-txt-link-abbreviated" href="http://www.anotherhost.com">www.anotherhost.com</a>") {
rewrite ^ <a class="moz-txt-link-freetext" href="http://www.somehost.com/someurl">http://www.somehost.com/someurl</a>;
}</code></pre>
<br>
Is it possible to redirect preserving url ?<br>
<br>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</body>
</html>