When a request comes to location \test, it will be processed by different phrases in sequence.
There are 3 main phrases highlighted here out of totally 11 phrases.
1, rewrite
2, access
3, content
Every directive has its own phrase handler to be executed. For example set directive is executed in rewrite phrase, but echo is only executed in content phrase.
For rewrite and access phrases, directives from multiple modules can be executed, but in phrase content only one module is allowed to execute. For example,echo and echo_by_lua are conflicted if used together.
Make sure you are using correct directives in different phrases.