Valid characters in nginx configuration

Aleksandar Lazic al-nginx at none.at
Fri Mar 17 12:53:40 UTC 2017


Hi.

Am 15-03-2017 18:00, schrieb SW at EU via nginx:

> Hi,
> 
> there can I find the description of the nginx configuration file syntax 
> e.g. in a BNF like notation. There is defined which characters are 
> allowed in "name" e.g. of an upstream definition? Only ASCII or UTF8, 
> only alpha or alphanumeric and if the last, must it start with alpha. 
> Can I use special characters like "@"? IMO is this the basic 
> information which should be on top of the documentation but either is 
> does not exists or is very good stashed ;-)
> 
> I'm not the first which ask this in the web: 
> http://stackoverflow.com/questions/36485834/valid-characters-in-nginx-upstream-name, 
> but there is no answer and it is from 10 years ago :-(
> 
> Can anyone help me please? Maybe I use wrong search terms.

The name in upstream source is defined as ngx_str_t and ngx_str_t is 
defined here 
http://hg.nginx.org/nginx/file/tip/src/core/ngx_string.h#l16 as u_char.

You can try different charakters and see if it works.

Cheers
Aleks


More information about the nginx mailing list