[PATCH] Contrib: vim syntax, listen option and SSL/Mail protocol keywords

Maxim Dounin mdounin at mdounin.ru
Tue Feb 21 18:13:30 UTC 2017


On Tue, Feb 21, 2017 at 11:31:41PM +0800, OOO wrote:

> Yes, have simple way to fix.
> One question before commit.
> Does string in nginx conf supports multiline?
> Or only single line string is valid?

Configuration directives can span multiple lines.  LF and CR can 
appear anywhere where whitespaces are allowed.  Only comments are 
single-line, starting from "#" and to the end of the string (from 
"#" to LF).

Parsing code is available here:


A formal description of grammar used can be found in OpenBSD 
manual pages at http://man.openbsd.org/OpenBSD-5.5/nginx.conf.5.  
It looks mostly correct as far as I can tell, but doesn't describe 
all nuances - in particular, it doesn't seem to tell anything 
about quoted strings.  Refer to the code if in doubt.

Maxim Dounin

More information about the nginx-devel mailing list