simple reverse web proxy need a little help
Francis Daly
francis at daoine.org
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
> 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 at daoine.org
More information about the nginx
mailing list