Introduction: Nginx rewrite rewrite rules and anti-theft chain configuration method, rewrite rule format flag tags in several forms, hotlinking return 403 error, allow the domain name directly following the second row of the domain name.
Nginx common pseudo-static rules (rewrite)-Discuz X3.2-WordPress-PHPCMS-ECSHOP-SHOPE (convert), nginx-discuz
When we switch from an apache server to an Nginx server, their pseudo-static rules are different. Therefore, you are fami
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 rules to
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 the required rules in the server.
Copy Code code as follows:
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
Routing overrides are a very important basic feature of the Web server. By routing rewriting, you can structure URLs and be more semantic (useful for SEO). In addition, the sharing of the URL may be due to the program routing changes in the URL invalidation, and route rewriting can be a good solution to such problems.
The proper use of the rewrite function can bring us a lot of benefits. The functionality of rewr
CI nginx Rewrite rules server {Listen 80;server_name ttlsa.com www.ttlsa.com;root/data/site/www.ttlsa.com;Index index.php;Error_log Log/error.log;# Set expiration of assets to MAX for cachingLocation ~*. (ico|css|js|gif|jpe?g|png) (? [0-9]+)? $ {Expires Max;Log_not_found off;}# main CodeIgniter rewrite ruleLocation/{Tr
Objective:There is a very important concept in Nginx, which is the rewrite rule. It modifies the URL and then makes internal redirects. Rewrite granted Nginx more freedom, making the post-service access more local.This article will briefly describe the rewrite
supported) the server does not support the HTTP protocol version used in the request.
Rewrite logo bit:
# # #Nginx URL rewrite will still be rewrite check, up to retry 10 times, if 10 times are still not terminated will return HTTP CODE 500###
Break: Stops rewrite detect
or http/1.1.Server_addr #服务器地址, this value can be determined once the system call has been completed.server_name #服务器名称.Server_port #请求到达服务器的端口号.
Seven The correspondence between Apache and Nginx rules
The rewritecond of Apache corresponds to the Nginx ifThe rewriterule of Apache corresponds to the rewrite of Nginx.
/resizer/bla.jpg?width=500height=400 address and will continue to attempt to match the location.Examples of two-layer redirects similar to PhalconServer {Listen the; server_name localhost; #charset Koi8-R; Access_log logs/Localhost.access.log Main; Location/{root d:/WebRoot; Index index.html index.htm index.php; } #error_page404/404. html; # REDIRECT Server error pages to the static page/50x.html error_page - 502 503 504/50x.html; Location= /50x.html {root html; } # Proxy The PHP s
/server-12-12-12-12.html,The actual access is http://www.wxl-dede.com/server/12/12/12/12.html6. Disable access to a directoryLocation ~ ^/(cron|templates)/{Deny all; Break}7. Access different content for different browsersif ($http _user_agent ~ Chrome) {Rewrite ^ (. *) $/data/index.html break;}8. Customizing the shelf life time of a file of a certain typeLocation ~* \. (js|css|jpg|jpeg|gif|png|swf) $ {if (-f $request _filename) {Expires 1h;Break}}
[Author: Zhang banquet this article version: V1.1 final modification: 2009.12.01 reprinted please indicate the original article link: http://blog.s135.com/bo-blog_nginx_rewrite/]
Bo-blog is a single-user blog program developed using PHP. My blog also uses Bo-blog. I personally think it is much better to typeset and use Bo-blog than WordPress, but it is not as scalable as WordPress.
Many of my friends asked me how to write the nginx
CodeIgniter on nginx and find that all the pages except the homepage are 404, it must be a Rewrite rule error. Many of the rules found on the Internet seem useless.
Here is a Rewrite rule available for CodeIgniter in nginx (index. php is not removed ).
Location/{if (-f $
Wordpress 3.0 rewrite Rules in nginx
The multi-site feature has been enabled in wordpress recently, and the test is normal. However, when I insert an image in the article, I encountered a problem. Follow the previous installation settings. One step is to create the blogs. dir directory under the wp-content directory to store the files uploaded by the user. When 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.