The configuration method of the nginx configuration file is as follows:
[Code] bash code:
Server {
Listen 80;
Server_name www. php2.cc; # Here is the site url
Root/home/www/php2; # The Site root directory
Location /{
Index index.htm index.html index. php admin. php;
Rewrite ^/Public/Min/(. *) $/Public/Min/index. php/$1 last;
Rewrite ^ ([a-z] =. *)/Public/Min/index. php? $1 last;
# If the file in the access path does not exist, rewrite the URL and forward it to ThinkPHP for processing.
If (! -E $ request_filename ){
Rewrite ^/(. *) $/index. php/$1 last;
Break;
}
}
Location ~ \. Php /?. * $ {
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
# Load Nginx default "server environment variable" configuration
Include fastcgi. conf;
# Set PATH_INFO and rewrite the SCRIPT_FILENAME and SCRIPT_NAME server environment variables
Set $ fastcgi_script_name2 $ fastcgi_script_name;
If ($ fastcgi_script_name ~ "^ (. + \. Php) (/. +) $ "){
Set $ fastcgi_script_name2 $1;
Set $ path_info $2;
}
Fastcgi_param PATH_INFO $ path_info;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name2;
Fastcgi_param SCRIPT_NAME $ fastcgi_script_name2;
}
}