Skip to content

Instantly share code, notes, and snippets.

@shuson
Created December 30, 2015 10:15
Show Gist options
  • Save shuson/1c604c2bc7b97f073cf2 to your computer and use it in GitHub Desktop.
Save shuson/1c604c2bc7b97f073cf2 to your computer and use it in GitHub Desktop.
Brief of phrase "REWRITE", "ACCESS" and "CONTENT" in Nginx

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment