Welcome! Log In Create A New Profile

Advanced

upstream prematurely closed connection while reading response header

April 23, 2013 06:19PM
На FreeBSD 9.1 сервере используется связка nginx+phpFPM (1.2.8 и 5.4.13 (cli)). Проблема заключается в импорте дампов баз в phpMyadmin. zip файлы, примерно от 3 мб и выше не импортируются, выдает ошибку -

502 Bad Gateway

В логе появляется такое -
[error] 49927#0: *196 upstream prematurely closed connection while reading response header from upstream, client: 7X.XX.X.6X, server: domain.com, request: "POST /php3/import.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php5-fpm.sock2:", host: "domain.com", referrer: "http://domain.com/phpmyadmin/db_import.php?db=testdb&server=1&token=9ee45779dd53c45b7300545dd3113fed"

Основной конфиг nginx.conf

user www www;
worker_processes 2;
error_log /var/log/nginx-error.log error;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
}
http {

upstream backend {
server unix:/tmp/php5-fpm.sock;
}
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
log_not_found off;
server_tokens off;
sendfile on;
server_names_hash_bucket_size 128;
client_max_body_size 200m;
client_body_buffer_size 1m;
keepalive_timeout 10;
port_in_redirect off;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_min_length 0;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6].(?!.*SV1)";
include /usr/local/etc/nginx/Includes/*.conf;
}

Конфиг хоста

server {
listen 80;
server_name www.domain.com;
rewrite ^ http://domain.com$request_uri?;
error_log /var/log/www/domain.com/nerror.log;
}
server {
listen 80;
server_name domain.com;
server_name_in_redirect off;
root /home/www/domain.com;
index index.php index.html index.htm;
location ~* ^.+\.(ico|js|gif|jpg|jpeg|png|bmp)$ {
expires 30d;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/tmp/php5-fpm.sock2;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;

fastcgi_intercept_errors on;
fastcgi_ignore_client_abort on;
fastcgi_connect_timeout 60s;
fastcgi_send_timeout 200s;
fastcgi_read_timeout 200s;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
}

Пробовал увеличивать таймауты, менять размер буферов - не помогло.
Хамидулин рекомендует трогать параметры
proxy_buffer_size
large_client_header_buffers

Но у меня таких даже нет, стоит их добавить и пробовать ?
Вот https://gist.github.com/RuslanHamidullin/3894466 как раз вторая ошибка мой случай.
Вдруг тут проблема - php.ini http://pastebin.com/vCZdNVSY и my.cnf http://pastebin.com/6XSE75XS
Subject Author Posted

upstream prematurely closed connection while reading response header

Demontager April 23, 2013 06:19PM

Re: upstream prematurely closed connection while reading response header

Валентин Бартенев April 24, 2013 04:42PM

Re: upstream prematurely closed connection while reading response header

Demontager April 24, 2013 05:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready