I have a web server (nginx, iis, apache, whatever) on which I access: http://1.1.1.1 => displays default page http://virt1 => displays virtual host 1 (ping virt 1 = 1.1.1.1)
When I access the url virt1 the page of the corresponding virtual host
which
is different from when I access the url with the ip adress
NB: if I access http://1.1.1.1/virt1, it’s the same page as http://virt1
I use a nginx server in front of it as a reverse proxy and use a virtual
host. When I access http://portal, I want it to display the page as if
it
was http://virt1
My configuration starts like this
upstream webservers { server virt1:80; }
server {
listen 80;
server_name server_name portal;
index index.php index.html;
location @proxy {
proxy_pass http://webservers;
include /etc/nginx/proxy_params;
}
With this configuration it works but not as I wish.
When I access the page http://portal it displays the page as if I
accessed http://1.1.1.1 but I wanted it to display the page that looks like http://virt1
If I access http://portal/virt1 it displays the correct page.
Conclusion my configuration makes my nginx connect to the right server
but
doesn’t send a parameter so that I access on the right virtual host.
On Tue, Mar 15, 2016 at 08:20:25PM -0400, miky wrote:
Hi there,
I use a nginx server in front of it as a reverse proxy and use a virtual
host. When I access http://portal, I want it to display the page as if it
was http://virt1