I. Location Syntax:
Location [= | ~ | ~ * | ^ ~] /Uri /{... }
Note: 1 ,~ For case-sensitive matching 2 ,~ * Case-insensitive matching 3 ,!~ And !~ * Case-insensitive and case-insensitive do not match. Example 1:
Location /{}
Match any query because all requests start. However, regular expression rules are preferentially matched with queries.
Example 2:
Location = /{}
Match only/
Example 3:
Location ~ *
Example
The code is as follows
Copy Code
server {Listen 80;root/path/to/dilicms/;Index index.php;server_name www.111cn.net; Location ~ ^ (/(application|system|services|shared|admin/backup|admin/config|admin/controllers|admin/core|amdin/ Errors|admin/hooks|admin/language))/{Deny all;} Location/{ if ($request _uri ~* index/?$){Rewrite ^/(. *)/index/?$/$1 Permanent;} if (!-d $request _filename){
请求到后端应用服务器#非静态文件请求就默认是动态请求,自己根据实际把握#毕竟目前的一些框架的流行,带.php,.jsp后缀的情况很少了location / { proxy_pass http://tomcat:8080/}Http://tengine.taobao.org/book/chapter_02.htmlHttp://nginx.org/en/docs/http/ngx_http_rewrite_module.htmlRewrite rulesThe rewrite function is to implement URL rewriting and redirection in conjunction with regular expressions and flag bits using nginx-provided global variables or variables that you s
here's how to make Nginx support thinkphp pathinfo and URL rewrite mode. 1, Thinkphp gives the official solution of thinkphp, as follows:Open Nginx configuration file/etc/nginx/nginx.cof is generally in this path, depending on your installation path may vary. If you configure Vhost, and you only need this one vhost sup
Common nginx rewrite examplesI believe that in daily O M, if you use nginx as the front-end reverse proxy server, you will love and hate nginx rewrite because you have done it, after the developer's jump needs are met, you will feel very good and really powerful, hate it be
%{request_filename} directly! -F rewritecond%{request_filename}! -D # If the request is not a real file or directory, distribute the request to index.php rewriterule. index.php 3. Restart Apache(iii) there is another way to configure the Apache server without restarting, when the change took effect. 1. Add the. htaccess code below the "F:/wamp64/www/yii2/frontend/web" directory: rewriteengine on # If the requested file or directory is real, Access Rewritecond%{re
Once the last:rewrite is matched, a request will be initiated again, and only the rules in the location will be matched again.After a match is break:rewrite, the request is not initiated and the subsequent rules are not matched.Example:Location/{root HTML;Index index.php index.html index.htm;}if ($request _uri ~*/cms/) {Rewrite "^/cms/(. *) \.php"/cms/index.php b
The final effect is as follows:In fact, it is very simple, first create a test.php file in the HTML directory, as follows:Then use VI to open him, write a test source code, the source code is as follows:Then save exit, go to/usr/local/nginx/conf to find nginx.conf configuration file, modify it.In the 46 line to add the rules can be modified, white to play regular expression just, "$" is the
Tags: NGINX proxy rewrite cacheShare the next Nginx+rewrite+proxy+cache todayThe difference between Nginx and Apache1.nginx based on IP restrictionsSmall experiment:worker_processes 1;events { worker_connections 1024;}http {
Sometimes, we need to install nginx separately to handle a large number of download requests. Rewrite and HTT for nginx installation on Centos5 separately
Sometimes, we need to install nginx separately to handle a large number of download requests. How to solve the rewrite a
Original address: http://blog.c1gstudio.com/archives/434
Recommended reference Address:
Mailing List Archives Official discussion areaHttp://marc.info/?l=nginx
Nginx Common Application Technology Guide [Nginx Tips]Http://bbs.linuxtone.org/thread-1685-1-1.html
This log content from the Internet and weekday use experience, organize a convenient reference for the fu
setting of Laravel frame rewrite under Nginx
Add the following to the Nginx vhost site configuration file:
if (!-d$request_filename) { rewrite ^/(. +)/$/$1 permanent;} if ($request _uri ~* index/?$) { rewrite ^/(. *)/index/?$/$1 Permanent;} if (!-e$request_filename
The built-in Rewrite Rules of wordpress are related to apache. This article describes how to configure the rewrite rules of wordpress under nginx. First, configure a php upstream to facilitate backend machine and port changes, and then configure the corresponding blog domain
However, many users still do not know the pseudo-static rules of the Nginx server. If you install common programs such as WordPress, PHPCMS, ECSHOP, SHOPEX, and Discuz 7, the pseudo-static rules are ready for use. To facilitate webmasters, we have collected pseudo-static rules for these common programs.
WordPress pseud
: This article mainly introduces an example of nginx domain name redirection ~~~ Rewrite and proxy. if you are interested in PHP tutorials, refer. A few days ago, I set up a forum server and put it in the company's LAN. the Forum uses port 9066 and implements port forwarding on the router, in addition, the domain name bbs.xxx.com is also directed to the company's public IP address, because users want to mak
thinkphp How to Implement "http://localhost/index.php?/module/Operation quo ... Change to "http://localhost/module/operation"
I want to change the URL into this form, it will look comfortable, but I do not know how to achieve.
Is the CONIFG inside add parameter, or in Nginx inside with rewrite?
Reply content:
thinkphp How to Implement "http://localhost/index.php?/module/Operation quo ... Change to "htt
More and more people take Apache to Nginx, for running PHP, transfer is more easy.But to achieve pseudo-static, the rewrite configuration will be more complex, most of the problems are here.Below is the nginx under Discuz URL rewrite configuration template, for everyone reference.Note: Modify the server_name,root for y
Transferred from: http://www.nginx.cn/1134.htmlHow can Nginx be configured to support CodeIgniter?1. CodeIgniter URL beautification to remove index.php
12345
Location / { root html/gxtp; indexindex. Php try_files $uri $uri/ /index. PHP? $uriamp; $args; }
2. The URL rewrite, as codeigniter as thinkphp, is also implemented using PATHINFO, which req
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.