Appendix B. The Rewrite Rule Guide
This appendix is meant to introduce the
rewrite module in NGINX and serve as a guide for creating new rules as well as translating legacy Apache rewrite rules into NGINX's format. In this appendix, we will discuss the following topics:
- Introducing the
- Creating new rewrite rules
- Translating from Apache
Introducing the rewrite module
rewrite module of NGINX is a simple regular expression matcher combined with a virtual stack machine. The first part of any rewrite rule is a regular expression. As such, it is possible to use parentheses to define certain parts as captures, which can later be referenced by positional variables. A positional variable is one in which its value depends on the order of the ...