首页 > 其他 > 详细

nigx下配置tp5.1路由

时间:2019-09-04 17:33:08      阅读:102      评论:0      收藏:0      [点我收藏+]

打开宝塔面板,找到你要配置路由的网站并找到配置文件(如图1)

技术分享图片

 

 (图1)

2.在配置文件里添加一下代码

set $root = /www/wwwroot/www.blogs.test/public; #当前应用的运行目录
location ~ \.php { fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_split_path_info ^((?U).+.php)(/?.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name; include fastcgi_params; } location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$ { root $root; } location / { root $root; index index.html index.php; if ( -f $request_filename) { break; } if ( !-e $request_filename) { rewrite ^(.*)$ /index.php/$1 last; break; } }

3.配置完成后,保存并重载配置和重启Nigx即可

技术分享图片

 

 

技术分享图片

 

nigx下配置tp5.1路由

原文:https://www.cnblogs.com/studyandstudy/p/11460232.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!