ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

upstream prematurely closed connection while reading response header


  • To: nginx-ru@xxxxxxxxx
  • Subject: upstream prematurely closed connection while reading response header
  • From: "Demontager" <nginx-forum@xxxxxxxx>
  • Date: Tue, 23 Apr 2013 18:19:08 -0400
  • Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=helium.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=QGnGktt+AtMUAAQ87BnJ+TO5lfZZ73aZDNPrd9bUAJ0=; b=h2fpCQBA1NVAlbXqhxnUf6PCYehF/HbgGnUB4LH0QalN28nzMu8nSA4Bj46O/DaAwX7s++S/Gy8CEfLv+pUQixEp8WM6dwimk/f2/1mOE6mj1ZbFL1LcAwbrXN23o9tU0jrhXdfaF8ANuy2R3UlOkEm65iFT5RGjyHhp6q2Ln7s=;

На 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

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,238590,238590#msg-238590

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.