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, 遇到很多问题, 记录之
时间: 2024-08-10 02:08:43

Nginx报错:Sorry, the page you are looking for is currently unavailable. Please try again later.的相关文章

springboot报错Whitelabel Error Page

第一次使用springboot没有问题.隔了两天继续看.一直报错Whitelabel Error Page. 重新搭建试了任何方法都错了. 报的就是一个404错误,犯了一个习惯性错误,一般都是localhost:8080/工程名字/requestMapping路径名 实际是: localhost:8080/requestMapping路径名 .不需要工程名字就可以访问了. 原文地址:https://www.cnblogs.com/dayanjing/p/10012281.html

解决nginx 报错提示:rewrite or internal redirection cycle while internally redirecting to "/",

配置好nginx+php-fpm,访问首页,提示报错: 2015/01/14 23:04:39 [error] 10964#2788: *2 rewrite or internal redirection cycle while internally redirecting to "/", client: 127.0.0.1, server: bk, request: "GET / HTTP/1.1", host: "bk" 报错原因:index

启动nginx报错问题

为了解决生产环境的bug,模拟生产环境,我使用了nginx,在安装启动的过程中,出现了很多问题. 1.nginx下载地址 http://nginx.org/en/download.html 这是nginx的下载地址,下载稳定版 2.安装 解压压缩包后,将解压后文件放到没有中文路径的目录下(若有中文,则报错log显示No mapping for the Unicode character exists in the target multi-byte code page) 3.启动 可以双击ngi

nginx报错 client intended to send too large body: 1331696 bytes

1,nginx后台error日志报错 2016/02/05 16:23:56 [error] 12024#0: *441106971 connect() failed (111: Connection refused) while connecting to upstream, client: 113.214.1.10, server: localhost, request: "GET /h5teb/ugcH5/index.htm?source=android&mall=8&TG

nginx 报错 nginx: [emerg] could not build the variables_hash,

在nginx重启的时候报错了: nginx: [emerg] could not build the variables_hash, you should increase either variables_hash_max_size: 512 or variables_hash_bucket_size: 64 此时按照网上的修改 以下这些内容,根本没用! types_hash_max_size 2048;    server_names_hash_bucket_size 128; 还是别改这些

【CentOS6.5】安装nginx报错:No package nginx available. Error: Nothing to do

今天在给centos6.5安装nginx时候,提示报错No package nginx available. Error: Nothing to do, 后来百度一下,说缺少EPEL(epel是社区强烈打造的免费开源发行软件包版本库,系统包含大概有1万多个软件包) 版本寻找地址:http://fedoraproject.org/wiki/EPEL我需要的是centos6.5 64位(适用于6.x),我直接找到源后wget下载到当前目录: wget http://dl.fedoraproject.

nginx报错 连接超时问题

问题:上传excel文件解析数据并加载数据到MySql数据库表中的时候,报错(该Excel文件有13105列)最终返回给浏览器 POST http://.......404 not found nginx 解决: 原因: 后台程序处理的时间过长,但是访问后端接口走的是nginx代理 nginx使用proxy模块时,默认的读取超时时间是 60s 后来设置如下参数解决 proxy_connect_timeout 后端服务器连接的超时时间_发起握手等候响应超时时间 proxy_read_timeout

nginx 报错504 gateway time-out

使用nginx访问本地项目的时候一直报错:gateway time-out 504,在项目的gateway的控制区域可以看见数据根本没有跑进来,此时查看进程管理器可以发现有很多个nginx.exe进程,此时使用taskkill /fi "imagename eq nginx.EXE" /f这个dos命令(cmd),可以杀死所有的nginx.exe进程,之后再运行nginx.exe,重新运行就可以了. 原文地址:https://www.cnblogs.com/aiwen/p/904480

nginx报错client_body_temp permission denied

故障描述 一次新sdk发布上线后,nginx正向代理出现很多500的请求,查看error.log发现有client_body_temp permission denied报错. client_body_temp 如果客户端POST一个比较大的文件,长度超过了nginx缓冲区的大小,需要把这个文件的部分或者全部内容暂存到client_body_temp目录下的临时文件. 故障原因: 新版本sdk发布后,发起的post请求body增大,超出了nginx缓存区大小,所以需要暂存在client_body

压测引起的 nginx报错 502 no live upstreams while connecting to upstream解决

对系统的某个接口进行极限压测,随着并发量上升,nginx开始出现502 no live upstreams while connecting to upstream的报错,维持最大并发量一段时间,发现调用接口一直返回502,即nginx已经发现不了存活的后端了. 通过跟踪端口,发现nginx 跟后端创建了大量的连接.这很明显是没有使用http1.1长连接导致的.因此在upstream中添加keepalive配置. upstream yyy.xxx.web{ server 36.10.xx.107