The [upstream][1]
directive in ngx_http_upstream_module is supposed to be in the http
context.
However, I'll have more than one server
inside the http
context, and I would like to have multiple upstream
with the same name but different server
s inside.
Could I put the upstream
directive inside the server
context to not conflict with the names? In other words, can we have lexical scope in the configuration?
CodePudding user response:
No, you can't.
If you try, you'll get:
nginx: [emerg] "upstream" directive is not allowed here in ...
You'll have to give it another name.