thinkphp nginx 404错误
来源:互联网 发布:windows系统正版 编辑:程序博客网 时间:2024/04/27 12:54
location ~ ^(.+.php)(.*)$ { fastcgi_pass unix:/tmp/php-cgi-rl.chuangjiangnet.cn.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fcgi-host.conf; fastcgi_param DOCUMENT_ROOT /web$subdomain; fastcgi_param SCRIPT_FILENAME /web$subdomain$fastcgi_script_name; }
server{ listen 80; server_name rl.chuangjiangnet.cn; #server_name end index index.html index.htm index.php; #index end set $subdomain ''; root /home/wwwroot/rl.chuangjiangnet.cn/web$subdomain; include rewrite/runlong.conf; #rewrite end #error_page location ~ /ErrorPages/(400|401|403|404|405|502|503)\.html$ { root /home/wwwroot/rl.chuangjiangnet.cn/web; }location ~ ^(.+.php)(.*)$ { fastcgi_pass unix:/tmp/php-cgi-rl.chuangjiangnet.cn.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fcgi-host.conf; fastcgi_param DOCUMENT_ROOT /web$subdomain; fastcgi_param SCRIPT_FILENAME /web$subdomain$fastcgi_script_name; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp3|wma)$ { expires 30d; } location ~ .*\.(js|css)$ { expires 12h; } access_log /home/wwwroot/rl.chuangjiangnet.cn/log/access.log combined; #access_log end error_log /home/wwwroot/rl.chuangjiangnet.cn/log/error.log crit; #error_log end}
做相应替换
修改完之后,返现访问网址居然自动省略了index
而且css 样式也不解析,
找了半天发现
是thinkphp 自身框架的原因
在 Thinkphp/ThinkPHP.php里面加入
define('_PHP_FILE_', rtrim($_SERVER['SCRIPT_NAME'],'/')); 搞定
0 0
- thinkphp nginx 404错误
- Nginx部署Thinkphp 404错误PathInfo的解决方案
- Nginx部署Thinkphp 404错误PathInfo的解决方案
- phpStudy+ThinkPHP配置的nginx环境出现404错误
- 解决nginx服务下 thinkphp只能访问首页不报任何错误的问题404错误
- 【thinkphp 5 在nginx 环境下路由无法生效(404 500错误 )的解决方法】
- 【thinkphp 5 在nginx 环境下路由无法生效(404 500错误 )的解决方法】
- 【thinkphp 5 在nginx 环境下路由无法生效(404 500错误 )的解决方法】
- 【thinkphp 5 在nginx 环境下路由无法生效(404 500错误 )的解决方法】
- nginx thinkphp
- thinkphp 错误页面404定制
- ThinkPHP错误
- Thinkphp 中自定义404错误页面
- Thinkphp 404错误页面 会导致漏洞
- Thinkphp 404错误页面 会导致漏洞
- thinkphp实例化就报404错误的总结
- thinkphp nginx 支持rewrite
- nginx 支持 ThinkPHP
- 深入理解Redux:10个来自专家的Redux实践建议
- 深入理解HashMap(及hash函数的真正巧妙之处)
- MFC中的#ifndef afx_msg #define afx_msg // intentional placeholder #endif
- 【NOIP2016提高A组模拟9.2】单峰
- poj 3145 The Domino Principle(bfs)
- thinkphp nginx 404错误
- Android(5)---Toast用法总结
- 简单数据采集(http://www.sina.com.cn/)
- 【设计模式】行为模式之Strategy策略
- Unsupported major.minor version 51.0解决方案
- 关于ARGB_8888、ALPHA_8、ARGB_4444、RGB_565的理解
- 配置虚拟主机目录
- Day27、文件夹内容的读取、软连接和硬链接文件、fctl文件锁的操作、Mycp.c
- 《ReactNative入坑记录(一)ReactNative介绍及环境搭建》