Scene advantages: URL access jump compatible support, SEO optimization, background maintenance, traffic forwarding, security
grammar:
Syntax: rewrite regex (regex) replacement [flag];
Context: server,location, if
For example, maintenance interface
rewrite ^(.*)$ /pages/maintain.html break;
flag:
last stop detection will request a new
New requests will not break stop detection, the request first determines the presence of
redirect returned 302 temporary redirect, the address bar after the jump address
permanent return 301 permanent redirect, the address bar after the jump address
The difference between the last and break
redirect and last difference
Before a client / test / request creates a temporary request destination 302 / test / 2 times back request
there will be a last request
permanent
After stopping nginx, as requested interface will be cached in the browser
redirect just temporary cache, the request will be slower again
Some common configuration