Toggle navigation
卡尔-个人博客
网站首页
博客讯息
个人日记
代码笔记
网站模板
软件工具
友情链接
关于我
代码笔记
返回
笔记详情
Nginx下配置ThinkPHP5框架
2019-06-24
356
Linxu、Windows系统内nginx配置tp5,默认目录配置为ThinkPHP5框架public文件夹,接着打开nginx配置文件,添加对应目录配置,复制下方详情
打开nginx,conf配置文件,添加如下代码,对应修域名、目录位置 ```php server { listen 80; # 监听端口 server_name www.xxx.com; # 站点域名 root "E:\xxx\public"; # 站点根目录 index index.html index.htm index.php; # 默认导航页 location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; } } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # PHP配置 location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #下面两句是给fastcgi权限,可以支持 ?s=/module/controller/action的url访问模式 fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #下面两句才能真正支持 index.php/index/index/index的pathinfo模式 fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } } ```
标签:
ThinkPHP5
Nginx
Linxu
上一篇: Linxu查询进程和IP连接
下一篇: 没有了
博客排行
1
Amazon EC2免费VPS防止超额被扣钱三大方法:流量 硬盘读写 运行时长
2
Hostry 外国VPS测评
3
JustHost 外国VPS测评
4
AutoCAD 2017 2018 2019 2020教育正版免费下载使用
5
第一篇博文
笔记排行
SSpanel 配置支付宝当面付f2fpay
宝塔面板配置SSPanel-V3-mod 前端搭建教程
Lightsail AWS SSH连接和创建root用户
SSPanel-V3-mod 后端搭建教程
paypal表单式在线付款
SSpanel 配置QQ邮箱
web特殊字体,字蛛字体压缩
云标签
更多标签 »
工具
Javascript
软件
Linxu
CSS
PHP
HTML
SS
服务器
ThinkPHP5
Nginx
Python
数据库
网站模板
企业网站
SSpanel
mongoDB
加速
Jquery
远程连接
×
扫一扫,关注我的微信!
在线联系
在线QQ
微信扫码