<div dir="ltr">You may want to define <a href="http://example.org">example.org</a> as an upstream if it is just an application server that handles requests, but not entirely sure what you're trying to accomplish...<div><br></div><div><div>upstream anything.you.want {</div><div>server 127.0.0.1:PORT # or domain name;</div><div>}</div></div><div><br></div><div><span style="font-size:12.8px">server {</span><br style="font-size:12.8px"><span style="font-size:12.8px">server_name </span><a href="http://example.com/" rel="noreferrer" target="_blank" style="font-size:12.8px">example.com</a><span style="font-size:12.8px">;</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">location / {</span><br style="font-size:12.8px"><span style="font-size:12.8px">proxy_pass </span><a href="http://example.org/" rel="noreferrer" target="_blank" style="font-size:12.8px">http://a</a>nything.you.want<span style="font-size:12.8px">;</span><br style="font-size:12.8px"><span style="font-size:12.8px">}</span><br style="font-size:12.8px"><span style="font-size:12.8px">}</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">HTH</span></div><div><span style="font-size:12.8px">Jeff</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 28, 2016 at 9:12 AM, stuwat <span dir="ltr"><<a href="mailto:nginx-forum@forum.nginx.org" target="_blank">nginx-forum@forum.nginx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I have the virtualhost file configured as the following:-<br>
<br>
server {<br>
server_name <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a>;<br>
<br>
location / {<br>
proxy_pass <a href="http://example.org" rel="noreferrer" target="_blank">http://example.org</a>;<br>
}<br>
}<br>
<br>
<br>
When I visit <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a> it redirects correctly to <a href="http://example.org" rel="noreferrer" target="_blank">example.org</a>, but I need<br>
it to show <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a> in the address bar. How can I do this?<br>
<br>
i tried changing it to<br>
<br>
location / {<br>
proxy_pass <a href="http://example.org" rel="noreferrer" target="_blank">http://example.org</a>;<br>
proxy_set_header Host <a href="http://example.com" rel="noreferrer" target="_blank">example.com</a>;<br>
}<br>
}<br>
<br>
but it still shows <a href="http://example.org" rel="noreferrer" target="_blank">example.org</a> in the address bar, what do I need to do?<br>
<br>
Thanks<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,270626,270626#msg-270626" rel="noreferrer" target="_blank">https://forum.nginx.org/read.<wbr>php?2,270626,270626#msg-270626</a><br>
<br>
______________________________<wbr>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>