Welcome! Log In Create A New Profile

Advanced

RE: duplicate ports across servers in nginx.conf

All files from this thread

File Name File Size   Posted by Date  
nginx.conf 4.5 KB open | download Yuval Abadi via nginx 05/31/2023 Read message
Yuval Abadi via nginx
May 31, 2023 02:16AM
Hi
Thanks for the response.

The link explains the problem, I think we could do better work for users.

If the configuration has 2 servers sharing the same name and the same port
I got this warning:
"nginx: [warn] conflicting server name "http://www.mut.com/" on 0.0.0.0:80, ignored"

Why not block this mistake?
I assume the second server ignored, but why let it possible?

If the servers do not have name
I got this warning:
nginx: [warn] conflicting server name "" on 0.0.0.0:9002, ignored
nginx: [warn] conflicting server name "" on 0.0.0.0:80, ignored

both warning:
first no way for NGINX gives good warning, both server looks the same.
if user did such mistake, better to block.

Why not enforce using at list one server have "listen default_server port"?
Why not enforce server names , and not let more than one server with same name?


Is NGINX set the bit default_server ,on the first "ngx_http_conf_addr_t", of the first server, that read from conf file? (if no default_server was defined)?

Thanks





-----Original Message-----
From: nginx <nginx-bounces@nginx.org> On Behalf Of Francis Daly
Sent: Tuesday, 30 May 2023 19:57
To: Yuval Abadi via nginx <nginx@nginx.org>
Subject: Re: duplicate ports across servers in nginx.conf

EXTERNAL MAIL: nginx-bounces@nginx.org

On Tue, May 30, 2023 at 06:50:19AM +0000, Yuval Abadi via nginx wrote:

Hi there,

> When I have 2 servers in nginx.conf with same listen port if the server have name, nginx issue warning ignore … but nit failed to load.
> What happens is only the first server in conf binds the socket.
> And worse, If no server names I did not get a warning.

Does https://nginx.org/en/docs/http/request_processing.html explain what you are seeing?

If not, can you show one small but complete configuration that shows the problem that you are reporting?

"name-based virtual servers" are based around listening on the same port, and having the http server responding differently based on the
Host: in the incoming request. It would be surprising if that feature became broken.

The documentation for "listen" at https://nginx.org/r/listen does note that some parameters only make sense when set once (or set the same each time, if they are set more than once); I don't know if you are hitting one of those cases?

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Attachments:
open | download - nginx.conf (4.5 KB)
Subject Author Posted

Reverse proxy to forward proxy to internet access

Miten Mehta May 25, 2023 07:44AM

Re: Reverse proxy to forward proxy to internet access

Francis Daly May 25, 2023 07:10PM

Re: Reverse proxy to forward proxy to internet access

Miten Mehta May 26, 2023 06:50AM

Re: Reverse proxy to forward proxy to internet access

Miten Mehta May 27, 2023 12:22AM

Re: Reverse proxy to forward proxy to internet access

Saint Michael May 27, 2023 12:40AM

Re: Reverse proxy to forward proxy to internet access

Francis Daly May 27, 2023 04:26AM

Re: Reverse proxy to forward proxy to internet access

Saint Michael May 27, 2023 10:44AM

Re: Reverse proxy to forward proxy to internet access

Francis Daly May 28, 2023 07:58AM

Re: Reverse proxy to forward proxy to internet access

Francis Daly May 27, 2023 04:14AM

Re: Reverse proxy to forward proxy to internet access

David Siembab May 28, 2023 12:00AM

Re: Reverse proxy to forward proxy to internet access

Saint Michael May 28, 2023 12:56AM

Re: Reverse proxy to forward proxy to internet access

Francis Daly May 27, 2023 03:50AM

Re: Reverse proxy to forward proxy to internet access

Miten Mehta May 29, 2023 07:06AM

duplicate ports across servers in nginx.conf

Yuval Abadi via nginx May 30, 2023 02:52AM

Re: duplicate ports across servers in nginx.conf

Francis Daly May 30, 2023 12:58PM

RE: duplicate ports across servers in nginx.conf Attachments

Yuval Abadi via nginx May 31, 2023 02:16AM

Re: duplicate ports across servers in nginx.conf

Francis Daly May 31, 2023 03:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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