2015-08-31 2 views
3

Что мне не хватает в моей конфигурации nginx/uwsgi/php-embed?Nginx не может разговаривать с uwsgi (преждевременно закрытое соединение)

rpm -qa|grep php

php-cli-5.4.16-36.el7_1.x86_64 
php-xml-5.4.16-36.el7_1.x86_64 
php-devel-5.4.16-36.el7_1.x86_64 
php-common-5.4.16-36.el7_1.x86_64 
php-5.4.16-36.el7_1.x86_64 
php-xmlrpc-5.4.16-36.el7_1.x86_64 
php-pdo-5.4.16-36.el7_1.x86_64 
php-pgsql-5.4.16-36.el7_1.x86_64 
php-embedded-5.4.16-36.el7_1.x86_64 
uwsgi-plugin-php-2.0.11.1-1.el7.x86_64 

/etc/nginx/conf.d/allbet.conf

server { 
    listen 8081; 
    # root /tmp; 
    # index index.html index.htm; 
    server_name 127.0.0.1; 
    location /allbet { 
     # uwsgi_pass unix:///run/uwsgi/allbet.sock; 
     uwsgi_pass 127.0.0.1:9081; 
     include uwsgi_params; 
    } 
} 

/var/log/nginx/error.log

2015/08/31 15:35:25 [error] 114498#0: *4 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /allbet/index.php HTTP/1.1", upstream: "uwsgi://127.0.0.1:9081", host: "127.0.0.1:8081" 

/и т.д. /uwsgi.ini

[uwsgi] 
uid = uwsgi 
gid = uwsgi 
pidfile = /run/uwsgi/uwsgi.pid 
emperor = /etc/uwsgi.d 
stats = /run/uwsgi/stats.sock 
emperor-tyrant = true 
cap = setgid,setuid 

/etc/uwsgi.d/allbet.ini

[uwsgi] 
chmod-socket = 777 
; maximum number of worker processes 
processes = 4 
; the user and group id of the process once it’s started 
uid = mpapec 
gid = mpapec 
;socket = /run/uwsgi/%n.sock 
socket = 127.0.0.1:9081 
master = true 
chdir = /home/mpapec/public_html/%n 
; php 
plugins = php 
; jail our php environment 
php-docroot = /home/mpapec/public_html/%n 
php-index = index.php 
; clear environment on exit 
vacuum = true 

/home/mpapec/public_html/allbet/index.php

<?php 

print "pong\n"; 

ответ

1

В файле /etc/nginx/conf.d/allbet.conf вы должны добавить uwsgi_modifier1 14; только после того, как include uwsgi_params;.

Это в основном инструктирует uWSGI для направления запроса на плагин PHP.

Смежные вопросы