nginx常见错误---持续更新
来源:互联网 发布:linux将文件夹打包 编辑:程序博客网 时间:2024/03/29 21:58
1.nginx对PHP文件报File not found.错
今天在配置nginx+php5.4的时候,配置完成后,浏览器打开php文件就提示File not found.错误。
纠结半天,终于发现错误的地方了:
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改成如下这句,即可
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
server {
listen 80;
server_name *.example.com;
root /home/nginx/vhosts/example.com/web;
location / {
index index.php;
}
location ~ \.php$ {
root /home/nginx/vhosts/example.com/web;
fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
今天在配置nginx+php5.4的时候,配置完成后,浏览器打开php文件就提示File not found.错误。
纠结半天,终于发现错误的地方了:
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改成如下这句,即可
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
server {
listen 80;
server_name *.example.com;
root /home/nginx/vhosts/example.com/web;
location / {
index index.php;
}
location ~ \.php$ {
root /home/nginx/vhosts/example.com/web;
fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
2.Nginx访问二级目录的时候不加/(反斜杠)无法访问
if (-d $request_filename){
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
}
3.[emerg]: unknown directive "if($request_method" in /export/servers/nginx/conf/nginx.conf:86
一种是少pcre包
另一种是:
if 和括号间需要空格,坑爹啊
0 0
- nginx常见错误---持续更新
- twitter storm 常见错误-持续更新
- ios 常见错误整理 持续更新
- MySQL Replication常见错误整理[持续更新...]
- C++常见错误及解决方法,持续更新
- ios 常见错误整理 持续更新
- ios 常见错误整理 持续更新
- 常见错误(持续更新中~)
- iOS常见错误(持续更新)
- MAVEN 一系列常见错误(持续更新)
- Unix C 常见编译错误总结(持续更新)
- Unix C 常见编译错误总结(持续更新)
- Brew中常见错误管理!(持续维护更新)
- Eclipse/JAVA/Android 开发常见错误(持续更新)
- 六、 Android常见错误 (持续更新中……)
- C语言常见错误提示(持续更新)!
- Flume常见错误整理(持续更新ing...)
- Xcode常见编译错误以及解决方法汇总(持续更新)
- hdu(Number Sequence 1711)kmp
- hdu1025(最长上升子序列)
- Monkey and Banana hdu(1069)
- 报错:Link of class 'Lcom/.../PersistentConnectionListener;' failed ...VFY: unable to resolve new-insta
- A Problem With Fibonacci Sequence
- nginx常见错误---持续更新
- Similar Word
- The Frog’s Games(hdu 4004)
- hdu1003
- poj 1067
- 由poj 1067引发的——取石子游…
- 火星A+B
- hdu 1005
- hdu(1166)敌兵布阵