1 Star 0 Fork 0

max/max

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
max.taohaomi.com.conf 2.73 KB
一键复制 编辑 原始数据 按行查看 历史
max 提交于 2018-05-12 12:37 . Initial commit
server{
listen 443;
server_name demo5.thinkphp.com;
root 你的 ThinkArtist目录/public; # 该项要修改为你准备存放相关网页的路径
# ssl on;
# ssl_certificate cert/demo5.thinkphp.com.pem;
# ssl_certificate_key cert/demo5.thinkphp.com.key;
# ssl_session_timeout 5m;
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_prefer_server_ciphers on;
location / {
index index.php index.html index.htm;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite ^/(.*)$ /index.php?s=$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
}
}
location /api/ {
index index.php index.html index.htm;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename)
{
#地址作为将参数rewrite到index.php上。
#rewrite ^/(.*)$ /index.php?s=$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
rewrite ^/api/(.*)$ /api/index.php?s=$1;
}
}
location ~* \/upload\/.+\.(html|php)$ {
return 404;
}
location ~* ^\/plugins\/.+\.(html|php)$ {
return 404;
}
location ~* \/themes\/.+\.(html|php)$ {
return 404;
}
#proxy the php scripts to php-fpm
location ~ \.php {
include fastcgi_params;
##pathinfo支持start
#定义变量 $path_info ,用于存放pathinfo信息
set $path_info "";
#定义变量 $real_script_name,用于存放真实地址
set $real_script_name $fastcgi_script_name;
#如果地址与引号内的正则表达式匹配
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
#将文件地址赋值给变量 $real_script_name
set $real_script_name $1;
#将文件地址后的参数赋值给变量 $path_info
set $path_info $2;
}
#配置fastcgi的一些参数
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
###pathinfo支持end
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
}
}
server {
listen 80;
server_name demo5.thinkphp.com;
rewrite ^/(.*) https://$server_name/$1 permanent;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/taohaomi/max.git
git@gitee.com:taohaomi/max.git
taohaomi
max
max
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385