linux或windows下nginx开启phpinfo模式功能怎么配置
时间:2023-05-17 20:54
复制代码 代码如下: location ~ .php(.*)$ { 一个完整的站点配置示例: 复制代码 代码如下: log_format v.lzw.me '$remote_addr - $remote_user [$time_local] "$request" ' # urlrewrite location ~ .php(.*)$ { location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ { location ~ .*.(js|css)?$ { access_log /wwwlogs/v.lzw.me.log v.lzw.me; 其他方法参考(适合windows下的nginx等): 复制代码 代码如下: location ~ .php 以上就是linux或windows下nginx开启phpinfo模式功能怎么配置的详细内容,更多请关注Gxl网其它相关文章!
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;
}
'$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;
include v.lzw.me.conf;
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;
}
expires 30d;
}
expires 12h;
}
}
{
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;
}