Reverse proxy should send server_name

Mik J mikydevel at yahoo.fr
Tue Nov 22 21:28:51 UTC 2016


Hello Francis,Thank you very much.Everything works fine. Have a nice week 

    Le Mardi 22 novembre 2016 21h55, Francis Daly <francis at daoine.org> a écrit :
 
 

 On Tue, Nov 22, 2016 at 06:51:28PM +0000, Mik J via nginx wrote:

Hi there,

> location ^~ / {
>          proxy_pass        http://10.1.1.1/service1;And it works but the request appears is if the client typed http://10.1.1.1/service1/ from the web server point of view

> What should I write on the reverse proxy so that the IP paquet is sent to 10.1.1.1 but the HTTP GET request hits the virtual host service1.mydomain.org on the back end web server ?

Either use "proxy_set_header" (http://nginx.org/r/proxy_set_header) to
set Host (and consider "proxy_redirect" too); or create an "upstream"
called service1.mydomain.org and "proxy_pass" to that.

Note that if your "location" ends in /, you probably want your
"proxy_pass" to end in / too.

Cheers,

    f
-- 
Francis Daly        francis at daoine.org


 
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20161122/f6ff20f0/attachment.html>


More information about the nginx mailing list