Question regarding syntax of nginx configs

Awal Garg awalgarg at gmail.com
Sun Nov 15 08:44:25 UTC 2015


Heyo!

I am writing a configuration parser for nginx (in Python). It appears
as if the following constructs are dismissed as invalid by
https://github.com/nginx/nginx/blob/master/src/core/ngx_conf_file.c#l636:

```
...<STRING_TOKEN> <BLOCK> <STRING_TOKEN>;
```
and
```
...<STRING_TOKEN> <BLOCK>;
```

(STRING_TOKEN is any token like `server` or `listen`. I don't really
know what to call them here :/)

IOW, it seems that for every directive, a leaf representing a block
can only come at the end of a directive and must not be followed by a
statement-terminator.

Am I correct in inferring this? Does this mean there isn't any
directive possible which takes more than one block at once?

Thanks a ton!

Regards,
Awal



More information about the nginx-devel mailing list