Welcome! Log In Create A New Profile

Advanced

Re: simple reverse web proxy need a little help

Francis Daly
December 07, 2017 03:06AM
On Wed, Dec 06, 2017 at 05:27:01PM -0500, qwazi wrote:

Hi there,

> is, one of the domains on the server that has 2 isn't resolving correctly
> from the outside world. It only resolves correctly when you use just
> http://domain.com. If you use http://www.domain.com it resolves to the
> vhost1 domain.

Your client does a lookup for whatever name you request, and finds the
IP address to connect to; then it connects to that.

If that IP address corresponds to nginx, then nginx can get involved.

> server {
> server_name domain1.com;

> server {
> server_name domain2.com;

> server {
> server_name domain3.com;

When a request comes to nginx, it will look at all of the server{}
blocks (in this case), and then choose which one to use based on the
server_name setting and the Host header that the client sent -- which
is the name that you want to connect to.

If you use domain2.com, nginx will choose the second one, because
it matches.

If you use www.domain2.com, it does not match any of the server_name
settings that you have, so nginx does not know which server{} to
choose. It chooses its default server{}.

http://nginx.org/r/server_name

Change your nginx config to tell it all of the names that you want each
server{} to handle.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

simple reverse web proxy need a little help

qwazi December 06, 2017 05:27PM

Re: simple reverse web proxy need a little help

pbooth December 06, 2017 05:44PM

Re: simple reverse web proxy need a little help

qwazi December 06, 2017 09:17PM

Re: simple reverse web proxy need a little help

qwazi December 06, 2017 09:29PM

Re: simple reverse web proxy need a little help

Francis Daly December 07, 2017 03:06AM

Re: simple reverse web proxy need a little help

qwazi December 07, 2017 11:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready