Opened 5 years ago

#1883 new enhancement

nginx -t doesn‘t complain about wrongly formatted server_name directive

Reported by: nirtuj@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.14.x
Keywords: Cc:
uname -a: Linux 4.15.0-66-generic x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.14.0 (Ubuntu)
built with OpenSSL 1.1.1 11 Sept 2018

Description

Recently I was setting up a server and I made a mistake:

server_name:  www.example.com, test.example.com;

The comma is wrong, but I didn‘t notice. I ran nginx -t and it reported „Syntax is ok“ .
Afterwards I spent some time to find out why it didn‘t work.

Suggestion:
If the the value of a directive appears to be a comma separated list, nginx -t shoudl throw a warning.

Change History (0)

Note: See TracTickets for help on using tickets.