Weird problem cannot standup nginx on 443 ipv4

Francis Daly francis at daoine.org
Fri Apr 26 15:11:59 UTC 2019


On Thu, Apr 25, 2019 at 08:08:47PM -0500, Julian Brown wrote:

Hi there,

Well done in spotting that -- it has come up before, but obviously wasn't
something that someone noticed quickly enough this time.

> I finally figured it out, and I cannot believe it passed a syntax checker.

It passed a syntax check because it is syntactically valid.

> server {
>     server_name learngigs.com www.learngigs.com
> 
>     listen 443;
>     listen [::]:443;

It is inconvenient in this case; but "server_name" accepts a list
of whitespace-separated arguments. Your "server_name" directive has
four arguments.

It's not what you intended, but the computer (in general) does not care
what you intended; it cares what you wrote.

> I did not have a semi colon after the server name directive.   The syntax
> checker said it was fine, so I do not know what it was trying to do.

I suspect that this won't be "fixed", because the amount of special-casing
required in the code to handle it is probably not worth the effort to
anyone to write.

For example: a week ago, you would have liked if someone had previously
come up with a reliable and obviously-documented way that this specific
problem could be auto-avoided or -alerted. Today, you probably don't
need that work done, because you will remember to check for semi-colon
if you ever see the same problem again.

Great that you found and fixed the problem in the config!

Cheers,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list