Home  >  Article  >  Backend Development  >  [nginx] How to configure nginx rewrite so that it will not cause the browser URL address to redirect?

[nginx] How to configure nginx rewrite so that it will not cause the browser URL address to redirect?

WBOY
WBOYOriginal
2016-08-08 09:24:051808browse
P in [L, P] in the apache rules means forced to be a proxy. Of course, the URL you request will not change. Nginx does not force rewriting as a proxy parameter. Of course, you can also use a flexible location method:

  1. location ~ ^/article/ {
  2.   rewrite ^/article/([^/.]+)-p([0-9]+)(/?)$ /c/article/$1/ article-list/$2.shtml break;
  3. proxy_pass http://cs.jkg.com;
  4. }
Copy code

The above introduces [nginx] how to configure nginx rewrite so that it will not cause the browser URL address to redirect? , including relevant content, I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn