【问题标题】:Nginx and PHP-FPM on two separated server两个独立服务器上的 Nginx 和 PHP-FPM
【发布时间】:2016-01-24 20:54:31
【问题描述】:

我有两个单独的服务器。第一个是 192.168.122.2 ip addr 的 nginx 服务器。第二个是 192.168.122.3 ip 地址的 PHP-fpm 服务器。我必须修改我的 nginx 以使用其他 php-fpm 服务器。

我的 nginx 配置:

location ~ \.php$ {
                include snippets/fastcgi-php.conf;

                # With php5-cgi alone:
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 192.168.122.3:9000;
                fastcgi_buffers 16 32k;
                fastcgi_buffer_size 64k;


                # With php5-fpm:
                #fastcgi_pass unix:/var/run/php5-fpm.sock;
        }

在/etc/php5/fpm/pool.d/www.conf我添加了监听ip:

listen = 192.168.122.3:9000

但我收到 502 Bad gateway 错误。

我在 nginx 上遇到了这些错误:

2016/01/24 03:11:05 [error] 3902#0: *4 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.122.1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.122.3:9000", host: "192.168.1.179:8084"
2016/01/24 03:11:05 [alert] 3902#0: *4 write() to "/var/log/nginx/access.log" failed (28: No space left on device) while logging request, client: 192.168.122.1, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.122.3:9000", host: "192.168.1.179:8084"

我该如何解决这个问题?

【问题讨论】:

    标签: php nginx fastcgi


    【解决方案1】:

    您的配置看起来不错,但根据第二条日志行,您缺少磁盘空间,这会导致各种错误,包括与后端服务器的连接。

    【讨论】:

    • 这些是 linux 容器,所以我不知道如何添加更多空间。
    猜你喜欢
    • 1970-01-01
    • 2023-01-07
    • 2011-12-27
    • 1970-01-01
    • 2012-12-23
    • 1970-01-01
    • 2020-09-18
    • 2013-06-13
    • 1970-01-01
    相关资源
    最近更新 更多