How to turn on the function of phpinfo mode in nginx under linux/windows
This article introduces the knowledge of "how to turn on the phpinfo mode function of nginx under linux/windows". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The copy code is as follows:
Location ~\ .php (. *) ${
Fastcgi_pass unix:/tmp/php-cgi.sock
Fastcgi_index index.php
Fastcgi_split_path_info ^ (. +\ .php) (. *) $
Fastcgi_param script_filename $document_root$fastcgi_script_name
Fastcgi_param path_info $fastcgi_path_info
Fastcgi_param path_translated $document_root$fastcgi_path_info
# include fastcgi_params
Include fcgi.conf
}
An example of a complete site configuration:
The copy code is as follows:
Log_format v.lzw.me'$remote_addr-$remote_user [$time_local] "$request"'
'$status $body_bytes_sent "$http_referer"'
'"$http_user_agent" $http_x_forwarded_for'
Server {
Listen 80
Server_name v.lzw.me
Index index.html index.htm index.php default.html default.htm default.php
Root / www/v.lzw.me
# urlrewrite
Include v.lzw.me.conf
Location ~\ .php (. *) ${
Fastcgi_pass unix:/tmp/php-cgi.sock
Fastcgi_index index.php
Fastcgi_split_path_info ^ (. +\ .php) (. *) $
Fastcgi_param script_filename $document_root$fastcgi_script_name
Fastcgi_param path_info $fastcgi_path_info
Fastcgi_param path_translated $document_root$fastcgi_path_info
# include fastcgi_params
Include fcgi.conf
}
Location. *\. (gif | jpg | jpeg | png | bmp | swf) ${
Expires 30d
}
Location. *\. (js | css)? ${
Expires 12h
}
Access_log / wwwlogs/v.lzw.me.log v.lzw.me
}
Refer to other methods (suitable for nginx under windows, etc.):
The copy code is as follows:
Location\ .php
{
Fastcgi_pass 127.0.0.1:9000
Fastcgi_index index.php
Include fcgi.conf
Set $real_script_name $fastcgi_script_name
If ($fastcgi_script_name ~ "^ (. +?\ .php) (/. +) $") {
Set $real_script_name $1
Set $path_info $2
}
Fastcgi_param script_filename $document_root$real_script_name
Fastcgi_param script_name $real_script_name
Fastcgi_param path_info $path_info
}
This is the end of the content of "how to turn on the phpinfo mode function of nginx under linux/windows". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!