Recently, I tried to configure and install a website on VPs. VPs installed lnmp (Linux + nginx + MySQL + PHP) and often encountered some problems during rule resetting, directly using Apache rules to nginx does not work. In the past, Apache rewrite
Nginx in the use of pseudo static is directly in the nginx.conf write rules, do not need to be like Apache to open the Write module (mod_rewrite) in order to perform pseudo static.
Nginx only need to open the nginx.conf configuration file, write
1. Nginx Rewrite rules related directives
Nginx rewrite rules related directives have if, rewrite, set, return, break, etc., where rewrite is the most critical instruction. A simple
The Nginx rewrite rule syntax is as follows:
The
Route rewriting is an important basic function in Web servers. Through route rewriting, you can structure URLs and make them more semantic (good for SEO ). In addition, shared URLs may become invalid due to program route changes, and rewrite of
In the process of URL optimization, it is unavoidable to involve nginx rewrite rules. So how is the Nginx rewrite configured?Rewrite can be found in 4 places: ngx_http_srv_conf,ngx_http_sif_conf,ngx_http_loc_conf,ngx_http_lif_conf. correspond to
Comparison between nginx rewrite rules and apacheCommands related to nginx rewrite rules include if, rewrite, set, return, and break. rewrite is the most critical command. A simple nginx rewrite rule syntax is as follows: Rewrite ^/B/(. * tutorial
The use of pseudo-static in nginx directly writes rules in nginx. conf, and does not require pseudo-static operations like apache to enable the write module (mod_rewrite.Nginx only needs to open the nginx. conf configuration file and write the
1. Nginx Rewrite rules related directives
Nginx rewrite rules related directives have if, rewrite, set, return, break, etc., where rewrite is the most critical instruction. A simple nginx rewrite rule syntax is as follows:
Rewrite ^/b/(. *) \.html/
Nginx (pronounced "engine X") is a free open source Web server software developed by Russian software engineer Igor Sysoev. Nginx was released in 2004, focusing on high performance, high concurrency, and low memory consumption issues. And with a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.