server {
listen 80 default_server;
listen 443 default_server;
server_name _;
pagespeed off;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed EnableFilters remove_comments;
pagespeed EnableFilters collapse_whitespace;
location /Nginxstatus {
stub_status on;
}
set $ishttps "off";
set $root /var/www/nuoruishop/public;
root $root;
#入口文件
index giikin.php;
location / {
if ( $arg_refresh != 1)
{
rewrite_by_lua_file "/usr/local/nginx/lua/cache_home.lua";
}
root $root;
index index.html giikin.php;
if ( -f $request_filename) {
break;
}
if ( !-e $request_filename) {
rewrite ^(.*)$ /giikin.php/$1 last;
break;
}
}
location ~ .+\.php($|/) {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
if ($uri ~ "mobile/page/pay/index") {
rewrite_by_lua_file "/usr/local/nginx/lua/cache_detail.lua";
}
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index giikin.php?IF_REWRITE=1;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $script;
include fastcgi_params;
}
}
兼总条贯 知至知终