contain the entire file system path, because these paths are unknown at this processing stage. At this point, these two variables are just the initial values of the Request_uri variable. In order to get the system path, you can use a URL-based variable%{la-u:request_filename} in front of the detection. Nginx has a very strange phenomenon, in the regular midpoint (.) If there is no regular semantics of the statement in parallel, it is a simple point,
client, usually get or post.
$remote_addr: The IP address of the client.
$remote_port: The port of the client.
$remote_user: The user name that has been authenticated by the Auth Basic module.
$request_filename: The file path of the current request, generated by a root or alias instruction with a URI request.
$scheme: HTTP method (such as Http,https).
$server_protocol: The protocol used by the request, usually http/1.0 or http/1.1.
$server_addr: The server address, which can be de
We compile CentOS hand-compiled nginx, there will be a variety of compiler not to pass the error prompts, in general, the system is a lack of components, I will usually encounter the error tips are summed up:
First, error prompts./configure:error:the HTTP Rewrite module requires the PCRE library
Reason: The Pcre component is not installed
Solution: Install Pcre-devel
Yum-y Install Pcre-devel OpenSSL ope
I am using nginx and I have already add the line Location/file/ { ^/file/([0-9]+)/([0-9]+)/([ ^/]*)/([0-9]+)/(. *) $/file. php? ID=$1server=$2hash=$3expire=$4 File=$5last; }In the conf file of the domain.But the videos does not play.I have a try copy the parameters from the link to something likehttp://www.mydomain.com/file.php?id=1server=0hash=796609733f08c4bb8b89expire= 1464380369file=mp4/1.mp4And I can see the mp4 file playing if I pu
As you know, thinkphp is a widely used PHP development framework, so you need to support URLs rewrite and pathinfo in Nginx.Add the following lines to our Nginx configuration file.Accompanying text section:Location ~. php{Fastcgi_pass 127.0.0.1:9000;Fastcgi_index index.php;Set $real _script_name $fastcgi _script_name;if ($fastcgi _script_name ~ "^ (. +?\.php) (/.+) $") {Set $real _script_name $;Set $path _i
Regular Expression matching of nginx forwarding rules, where :*~ Case-sensitive matching *~ * Case-insensitive matching *!~ And !~ * These are case-insensitive and case-insensitive Files And Directories. *-f and! -F is used to determine whether a file exists *-d and! -D is used to determine whether a directory *-e and! -E is used to determine whether a file or directory exists *-x and! -X is used to determi
Nginx Pseudo-static rulesTo rewrite the http://lovo.com/index.php?t=3 with pseudo-static rules into http://lovo.com/t3.html, you can add in the Nginx conf/nginx.conf.Add in Location/{}, such as: location/{ root /var/www/html; index index.php index.html index.htm; rewrite
Add the following in location in the configuration file:Code
If (-d $ request_filename ){Rewrite ^/(. *) ([^/]) $ http: // $ host/$1 $2/permanent;}
in this way, nginx will make a judgment. If a folder is requested, the/symbol will be automatically added at the end. If a file is requested, the original URL is not changed. The following explains the code:
1, if (-d $ request_filename),
) ${Expires 24 h;Access_log off;} Restart your nginxFixed Link (URL rewriting) rules in nginxIt is only used for a single WordPress site (usually installed by default), not multiple sites. Insert the following code into the root of location: The code is as follows:Copy code If (! -F $ request_filename ){Set $ rule_1 1 $ rule_1;}If (! -D $ request_filename ){Set $ rule_1 2 $ rule_1;}If ($ rule_1 = "21 "){
Development environment
CodeIgniter 2.14PHP 5.4.18Nginx 1.4.2
CodeIgniter Configuration
The config.php file that opens Codeignite is modified as follows:
$config [' uri_protocol '] = "path_info";
Nginx Configuration
Open the Nginx profile nginx.conf file and modify it as follows:
# I am using the virtual host configuration
server {
listen ;
server_name dev.example.com;
Rew
Because there are some different from the Apache rules, we can't use Apache's WordPress rules directly.
Crap not say more directly on the code
The code is as follows
Copy Code
[Root@localhost ~]# cat/etc/nginx/wprw.confRewrite ^.*/files/(. *) $/wp-includes/ms-files.php?file=$1 last;if (!-e $request _filename) {
The code for converting nginx pseudo-static rules into apache rules nginx pseudo-static rules is as follows: try_files $ uri $ uriindex. php? $ Query_string; {code ...}
Turning nginx pseudo-static
Nginx to allow WordPress to support fixed-link pseudo-static rules
For Nginx to support WordPress fixed links is very simple, you need to add point configuration code:
Copy Code code as follows:
Location/{
if (-f $request _filename/index.html) {
Rewrite (. *) $1/index.html break;
}
if (-f $request _filena
Under the CI framework nginx rewrite rules, no longer 404http://blog.csdn.net/EI__Nino/article/details/8599304Server {Listen80; server_name222.73.130.124;Location/{Index Index. HTML index.htm Index.PHP; Root/data0/htdocs/www; if(!-E$request _filename) { //does not contain a file name #rewrite ^/(. *) $/index.p
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.