Nginx报错:Sorry, the page you are looking for is currently unavailable. Please try again later.
查看了进程, nginx, php-fpm都在运行, 排除程序错误, 那么就是配置的问题了.
一个可能的错误, 是由于配置中的 fastcgi_pass 配置错了
错误的配置如下
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:80;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
index index.php;
}
location / {
root /usr/share/nginx/html;
index index.html;
}
#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 /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
标红的地方, 我以为是端口, 但是不是, 具体应该是 php-fpm 处理php脚本的端口吧, 改成
fastcgi_pass 127.0.0.1:9000; 就好了 还有一个问题, 访问PHP可以访问了, 但是访问html不能访问, 是因为 蓝色标识的未添加, 就是下面这段
location / {
root /usr/share/nginx/html;
index index.html;
}
第一次搞nginx, 遇到很多问题, 记录之
Nginx报错:Sorry, the page you are looking for is currently unavailable. Please try again later.的更多相关文章
- nginx 报错 upstream timed out (110: Connection timed out)解决方案【转】
转自 nginx 报错 upstream timed out (110: Connection timed out)解决方案 - 为程序员服务http://outofmemory.cn/code-sn ...
- nginx报错:./configure: error: C compiler cc is not found, gcc 是已经安装了的
源码安装nginx报错,找不到gcc,但是实际上gcc是存在的,如下: # ./configure checking for OS + Linux -.el7.x86_64 x86_64 checki ...
- 新建SpringBoot项目运行页面报错Whitelabel Error Page This application has no explicit mapping for /error, so yo
新建SpringBoot项目运行页面报错Whitelabel Error Page This application has no explicit mapping for /error, so yo ...
- nginx报错zero size shared memory zone one
为了限速,在虚拟主机中加上了一个参数:limit_conn one 1:结果导致重启nginx报错: zero size shared memory zone "one"解决办法是 ...
- nginx报错:403 Forbidden 并且访问首页index.php是下载文件的状态
nginx报错:403 Forbidden 并且访问首页index.php是下载文件的状态,不能正常解析php 系统有其他两个站访问是正常的 看日志没有看到明显的错误 搜索了下: 答案如下: php的 ...
- springboot报错Whitelabel Error Page
第一次使用springboot没有问题.隔了两天继续看.一直报错Whitelabel Error Page. 重新搭建试了任何方法都错了. 报的就是一个404错误,犯了一个习惯性错误,一般都是loca ...
- Centos下yum安装Nginx报错 No package nginx available.
在Centos6下使用yum安装Nginx报错 解决方案: yum install epel-release
- 初学 Spring boot 报错 Whitelabel Error Page 404
按照教程,写了个最简单的 HelloWorld,尼玛报错 -->Whitelabel Error Page 404. 网上99%都是项目结构不对,说什么 Application放在父级 pack ...
- 安装Nginx报错“Cannot retrieve metalink for repository: epel. Please verify its path and try again”
CentOS 6.5中通过yum安装nginx报错. 搜了一下,很多都是修改某个配置文件的.但是在StackOverFlow的某个问题下,有人回答说修改配置文件并不是一个好的方法,虽然我采用了这个人的 ...
- nginx报错:nginx: [emerg] unknown directive in /etc/nginx/conf.d/test.conf:4
nginx报错:nginx: [emerg] unknown directive in /etc/nginx/conf.d/test.conf:4 解决: 第四行出现了 tab 空格 , 换成正常的 ...
随机推荐
- postgresql 多实例运行
创建新的实例, (下面所用到的9.1版本,如果为其他版本,可以用版本号替换9.1) sudo /usr/bin/pg_createcluster -U postgres ...
- day11基础代码——函数指针
// // main.m // Demo11 // // Created by scjy on 15/10/29. // Copyright © 2015年 lizhipeng. All ri ...
- [Usaco2006 Dec]Milk Patterns
[Usaco2006 Dec]Milk Patterns Description 农夫John发现他的奶牛产奶的质量一直在变动.经过细致的调查,他发现:虽然他不能预见明天 产奶的质量,但连续的若干天的 ...
- codeforces C. k-Tree
思路:dp[i][j]表示和为i,最大值为j的方案数. #include <cstdio> #include <cstring> #include <algorithm& ...
- ESXI转HYPER-V,问题接二连三啊(VMDK转VHD)
首先说软件: 要不是用SCVMM来转的话,我用得最爽的还是WINIMAGE,自然流畅.其它的都有各种问题. 其次说说配置更改: 如果原ESXI里只有一个硬盘,一切好说,如果里面挂载了两个,甚至三个硬盘 ...
- Hibernate 的*.hbm.xml文件的填写技巧
================================================================================= 模板: <!-- ?属性,本类 ...
- 电容式触摸控制器PCB布局
在目前市场上可提供的PCB(印刷电路板)基材中,FR4是最常用的一种.FR4是一种玻璃纤维增强型环氧树脂层压板,PCB可以是单层或多层. 在触摸模块的尺寸受限的情况下,使用单层PCB不是总能行得通的, ...
- BZOJ 1055 [HAOI2008]玩具取名
1055: [HAOI2008]玩具取名 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 1119 Solved: 653[Submit][Statu ...
- (转载)eclipse 快捷键大全,eclipse查找类,文件,添加注释
(转载)http://hi.baidu.com/fegro/item/8224c8c28b174627ee466598 /* ----------------------------------- ...
- HDOJ(HDU) 2123 An easy problem(简单题...)
Problem Description In this problem you need to make a multiply table of N * N ,just like the sample ...