分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 网页技术

Thinkphp在nginx设置同域名二级目录访问

发布时间:2023-09-06 02:11责任编辑:彭小芳关键词:nginx

   Thinkphp在nginx设置同域名二级目录访问,是因为最近弄一个小程序项目,要https,但是只有单个域名,不能通配域名,所有只好用二级目录,thinkphp二级目录访问要怎么设置呢

下面是nginx代码演示

server {
listen ?80;
server_name ??www.dc3688.com;
root /home/www/www.dc3688.com;

???location /huaqi/ {
???????????index ?index.php index.html index.htm;
???????????if (!-e $request_filename) {
???????????????rewrite ?^/huaqi/(.*)$ ?/huaqi/index.php?s=$1 ?last;
???????????????break;
???????????}
???????}
???location /geesi/ {
???????????index ?index.php index.html index.htm;
???????????if (!-e $request_filename) {
???????????????rewrite ?^/geesi/(.*)$ ?/geesi/index.php?s=$1 ?last;
???????????????break;
???????????}
???????}

??location ~ \.php {
???????????
???????????fastcgi_pass ??127.0.0.1:9000;
???????????fastcgi_index ?index.php;
???????????fastcgi_split_path_info ^(.+\.php)(.*)$;
???????????fastcgi_param PATH_INFO $fastcgi_path_info; ????????
???????????fastcgi_param ?SCRIPT_FILENAME ?$document_root$fastcgi_script_name;
???????????include ???????fastcgi_params;
???????}

}

以上代码通过测试完全没问题,每天分享一点,每天进步一点。

Thinkphp在nginx设置同域名二级目录访问

原文地址:https://www.cnblogs.com/96net/p/9506982.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved