Nginx 504超时初始wordpress安装

时间:2015-05-29 20:43:29

标签: php wordpress nginx

我正在尝试使用IP地址访问WordPress安装。我得到504超时错误。但是,我添加了一个info.php页面,我通过xx.xx.xx.xx / info.php请求提供给我的页面。

日志给出了这个错误:

upstream timed out (110: Connection timed out) while reading response header from upstream

我的网站启用文件是:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /var/www/test/wordpress;
    index index.php index.html index.htm;

    server_name xx.xx.xx.xx; #ip address here

    location / {
            # try_files $uri $uri/ =404;
            try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    error_page 404 /404.html;

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
            root /usr/share/nginx/html;
    }

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }

}

这是安装基本上是工作站点的AMI,但使用基于名称的URL,所以我无法理解为什么它不起作用。使用IP地址作为server_name有什么特别之处吗?

2 个答案:

答案 0 :(得分:1)

我的意见是通过重命名插件文件夹来禁用所有插件。

您也可以暂时将这些行添加到wp-config.php

define('WP_HOME','http://xx.xx.xx.xx');

define('WP_SITEURL','xx.xx.xx.xx');

但是根据我的经验,某些插件或主题是以某种方式编写的,您实际上需要在数据库中进行搜索和替换。

检查 php fpm错误日志可能会提供更多详细信息。

答案 1 :(得分:0)

事实证明我的AWS安全组设置未正确对齐。因此,如果有人遇到此问题,请检查您的Sec Group设置:)