Welcome! Log In Create A New Profile

Advanced

upstream server does not match virtual host

March 15, 2016 08:20PM
Hello,

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.

Do you know how to correct this ?

Thank you
Subject Author Posted

upstream server does not match virtual host

miky March 15, 2016 08:20PM

Re: upstream server does not match virtual host

Francis Daly March 16, 2016 04:36AM

Re: upstream server does not match virtual host

miky March 16, 2016 07:33AM

Re: upstream server does not match virtual host

Francis Daly March 16, 2016 12:54PM

Re: upstream server does not match virtual host - SOLVED

miky March 16, 2016 07:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready