simple reverse web proxy need a little help

Francis Daly francis at
Thu Dec 7 08:04:37 UTC 2017

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
>  If you use 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;

> server {
>  server_name;

> server {
>  server_name;

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, nginx will choose the second one, because
it matches.

If you use, 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{}.

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

Francis Daly        francis at

More information about the nginx mailing list