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 空格 , 换成正常的 ...
随机推荐
- objective-c基础教程
command+shift+c foundation框架包含的头文件 /system/library/frameworkks/foundation.framework/headers/
- github克隆项目中的子模块submodule时遇到的问题
GitHub真是个开源大宝库,不只能学习代码,还能学习git的使用! 最近在研究Off-the-Record-iOS项目(https://github.com/chrisballinger/Off-t ...
- vs 2015 菜单重复的问题解决方法
打开 “运行” 输入 D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe /resetuserdata ...
- 显示Mac电脑下的隐藏文件
1. 在应用程序里打开终端, cd 你的文件夹名 ls -a 即可显示该文件夹下的所有隐藏文件 2. 如果你想打开整个系统的隐藏文件可以在终端下输入以下命令 defaults write com.ap ...
- Unity网络斗地主 服务端
Unity网络斗地主 服务端 @by梦想之家2工作室 阿龙 已经做好了服务器框架,并且能实现服务器给客户端分牌的问题!
- struts配置时遇到的几个问题
1. struts在配置文件的时候,如果package包继承为 :extends="json-default" ,那么项目中要引入struts2-json-plugin-xxx.j ...
- BS_OWNERDRAW风格的作用和例子,值得研究~
TBitBtn就是一个例子: procedure TBitBtn.CreateParams(var Params: TCreateParams); begin inherited CreatePara ...
- Android NetWorkUtil
package com.android.hcframe.netdisc.util; import java.io.BufferedReader; import java.io.InputStreamR ...
- bzoj3339 bzoj3585
两题本质是一样,只不过3585要离散化这种不修改,不强制的问题,显然先考虑离线算法这道题的思路和bzoj1878非常像考虑到如果只是求每个前缀的mex,我们是很容易扫一遍就得出来的我们设为这个位置的m ...
- 一键安装mysql5.6
#!/bin/bash # @Name:install_mysql.sh # @Author:Eivllom # @Create -- # @Modify -- app_soft="/app ...