The difference between Nginx rewrite 4 configuration methods

  • redirect: 302 temporary redirect
  • permanent: 301 permanent redirection
  • last: The request jumps out of the current location, enters the server block, and re-matches the location. If there are more than 10 matches, a 500 error is reported. The client's url remains unchanged
  • break: The request will not jump out of the current location, but the resource matching will be performed according to the rewritten URL. If proxy_pass is configured in the location to the backend, the request URL received by the backend server will also be the rewritten URL. The client's url remains unchanged

Last is generally uninstalled in server or if, break is generally uninstalled in location

Refer to the following case:
The difference between Nginx rewrite 4 configuration methods

The difference between Nginx rewrite 4 configuration methods

Guess you like

Origin blog.51cto.com/xiaoahehe/2644059