欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

Nginx配置支持rewrite

程序员文章站 2022-06-16 23:21:04
...
Nginx配置支持rewrite
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

if (!-e $request_filename) #支持thinkphp
{
rewrite ^/([^(public_inf)].*)$ /index.php?s=$1 break; # 隐藏index.php
break;
}

AD:真正免费,域名+虚机+企业邮箱=0元