Welcome! Log In Create A New Profile

Advanced

Re: nginx reverse proxy proxy_pass weirdness

Francis Daly
December 18, 2019 11:30AM
On Wed, Dec 18, 2019 at 10:33:44AM -0500, deeztek wrote:

Hi there,

> Sorry maybe I am confusing you. The config file that I posted, works fine.
> What I request actually responds. So, if I were to request www.domain.tld,
> the Apache server behind Nginx responds with the correct website for
> www.domain.tld. However, if I were to delete the config file for domain.tld
> from nginx and I tried to browse to that domain again, nginx would forward
> the request to another (seemingly random?) website on Apache behind it.

Ok, that makes sense to me now, thanks.

You are deleting a full server{} block; not just a single directive
within a server{} block.

http://nginx.org/en/docs/http/request_processing.html has the details
on what nginx is doing.

In short - a request comes in on an ip:port, with a Host header. If
nginx has a listener on that ip:port that handles that Host header,
the matching server{} is used to handle the request. If not, then the
default server for that ip:port handles the request.

You can configure which server is the default_server for this ip:port
on the "listen" line (http://nginx.org/r/listen).

> I would think, deleting a config from Nginx, it would simply stop forwarding
> requests for that cofig.

Historical reasons / backwards compatibility / overall convenience means
that that isn't what happens by default.

You can configure it to happen on your system, if you want it to, by
configuring your default server for this ip:port explicitly, and having
that server drop the connection, or return 404 or 410, or return useful
content advertising your hosting service.


That is part of the answer to "what response do you want to get instead?".

Cheers,

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

nginx reverse proxy proxy_pass weirdness

deeztek December 18, 2019 04:48AM

Re: nginx reverse proxy proxy_pass weirdness

Francis Daly December 18, 2019 05:40AM

Re: nginx reverse proxy proxy_pass weirdness

deeztek December 18, 2019 07:18AM

Re: nginx reverse proxy proxy_pass weirdness

Francis Daly December 18, 2019 07:54AM

Re: nginx reverse proxy proxy_pass weirdness

deeztek December 18, 2019 10:33AM

Re: nginx reverse proxy proxy_pass weirdness

Francis Daly December 18, 2019 11:30AM

Re: nginx reverse proxy proxy_pass weirdness

deeztek December 18, 2019 12:35PM

Re: nginx reverse proxy proxy_pass weirdness

Francis Daly December 19, 2019 07:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 93
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