ПРОЕКТЫ 


  АРХИВ 


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]

Re: проблема с настройкой ngi nx+Tomcat


  • To: nginx-ru@xxxxxxxxx
  • Subject: Re: проблема с настройкой ngi nx+Tomcat
  • From: Дмитрий Кубышев <dkubyshev@xxxxxxxxx>
  • Date: Thu, 8 Apr 2010 13:45:33 +0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=7E7SyGjUlkwwiaKstJexRnfUiyA6NKs0nc2oRofb96Y=; b=AVbozz4UFH6z6luqMX2Xd+eCOriodoa8Z2EJOI3qRl5t3jfzMYJ36zCjbMbs73bI3/ k9x0uNr1lpDMnZxOF+ypJ/xxueFymNUGzmTvRBm0+x9DtNm2rIE7NPUI2B0m65SIRxqP mU9j6afYAhOhtDhPWFBuBsfOyzQ095Wt2q/mE=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DV3X4F0mYNcN0u3BblRms4BvBg6nJuUOn4MafSDLPETzOhHXo6blWWjx1pK6aTdiKJ xvPZrjtNLIHaLI/gBl2332C1ZTj2F8j2ppPxO9qQPv/nomQQE/2EyyVmRMTMOhrnyOI8 NWG8heJnVZnrUQ2d7Te/ABltMg/3gx86Jiibw=
  • In-reply-to: <4BBD9960.9040403@xxxxxxxxx>
  • References: <g2ref49d91c1004080136j5b4b556q8ff4ac5cf0dcb71e@xxxxxxxxxxxxxx> <4BBD9960.9040403@xxxxxxxxx>

worker_processes  1;
error_log  logs/error.log  debug;
events {
    worker_connections  1024;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
    access_log  logs/access.log  main;
    keepalive_timeout  65;

    server {
        listen       8882;

   # это томкату
   location / {
    proxy_pass http://phobos:8180;
    #proxy_redirect http://admintest.systematic.ru:8980 http://admintest.systematic.ru:8882;
    proxy_buffer_size 16k;
    proxy_buffers 4 16k;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   Host $http_host;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;

   }

   # это сами
     location ~* ^.+\.(jpg|jpeg|gif|js|css)$ {
     root C:/admtymen_test;
     access_log off;
     expires 30d;
   }
}
}

Вот конфиг. 502 вываливается практически моментально. Очень похоже что до томката вообще не доходит.

В еррор.логе:
*1 upstream prematurely closed connection while reading response header from upstream, client: 192.168.21.58, server: jupiter, request: "POST /hmao/admin/access_denied.htm HTTP/1.1", upstream: "http://192.168.20.70:8180/hmao/admin/access_denied.htm", host: "jupiter:8882", referrer: "http://jupiter:8882/hmao/"

8 апреля 2010 г. 12:52 пользователь Sergej Kandyla <sk.paix@xxxxxxxxx> написал:
Дмитрий Кубышев wrote:
Настраиваю связку nginx с Tomcat. Всё более-менее работает, за исключением одного момента - при отправке форм методом POST (формы поиска и логина) - возврщается 502 ошибка. такое ощущение что до томката запросы не доходят.

Конфиги в студию.
Томкат также может обрабатывать реквест слишком долго, из-за чего и 502 - понять proxy таймауты.
и что в error_log.



log:
2010/04/08 12:35:59 [debug] 1984#3556: worker cycle
2010/04/08 12:35:59 [debug] 1984#3556: select event: fd:248 wr:0
2010/04/08 12:35:59 [debug] 1984#3556: select event: fd:320 wr:0
2010/04/08 12:35:59 [debug] 1984#3556: select timer: 500
2010/04/08 12:35:59 [debug] 1984#3556: select ready 1
2010/04/08 12:35:59 [debug] 1984#3556: select read 320
2010/04/08 12:35:59 [debug] 1984#3556: *1 post event 007B38C0
2010/04/08 12:35:59 [debug] 1984#3556: timer delta: 0
2010/04/08 12:35:59 [debug] 1984#3556: posted events 007B38C0
2010/04/08 12:35:59 [debug] 1984#3556: posted event 007B38C0
2010/04/08 12:35:59 [debug] 1984#3556: *1 delete posted event 007B38C0
2010/04/08 12:35:59 [debug] 1984#3556: *1 malloc: 00784EA0:720
2010/04/08 12:35:59 [debug] 1984#3556: *1 malloc: 0078E4C8:1024
2010/04/08 12:35:59 [debug] 1984#3556: *1 malloc: 0078A460:4096
2010/04/08 12:35:59 [debug] 1984#3556: *1 http process request line
2010/04/08 12:35:59 [debug] 1984#3556: *1 WSARecv: fd:320 rc:0 716 of 1024
2010/04/08 12:35:59 [debug] 1984#3556: *1 http request line: "POST /hmao/admin/access_denied.htm HTTP/1.1"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http uri: "/hmao/admin/access_denied.htm"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http args: ""
2010/04/08 12:35:59 [debug] 1984#3556: *1 http exten: "htm"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http process request header line
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Host: jupiter:8882"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Accept-Language: ru,en-us;q=0.7,en;q=0.3"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Accept-Encoding: gzip,deflate"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Keep-Alive: 115"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Connection: keep-alive"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Referer: http://jupiter:8882/hmao/"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Cookie: JSESSIONID=570B6C3B0EB5B5125408180E537A984D"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Pragma: no-cache"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Cache-Control: no-cache"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Content-Type: application/x-www-form-urlencoded"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header: "Content-Length: 111"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http header done
2010/04/08 12:35:59 [debug] 1984#3556: *1 event timer del: 320: 3700467006
2010/04/08 12:35:59 [debug] 1984#3556: *1 generic phase: 0
2010/04/08 12:35:59 [debug] 1984#3556: *1 generic phase: 1
2010/04/08 12:35:59 [debug] 1984#3556: *1 test location: "/"
2010/04/08 12:35:59 [debug] 1984#3556: *1 test location: ~ "^.+\.(jpg|jpeg|gif|js|css)$"
2010/04/08 12:35:59 [debug] 1984#3556: *1 using configuration "/"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http cl:111 max:1048576
2010/04/08 12:35:59 [debug] 1984#3556: *1 generic phase: 3
2010/04/08 12:35:59 [debug] 1984#3556: *1 post rewrite phase: 4
2010/04/08 12:35:59 [debug] 1984#3556: *1 generic phase: 5
2010/04/08 12:35:59 [debug] 1984#3556: *1 generic phase: 6
2010/04/08 12:35:59 [debug] 1984#3556: *1 generic phase: 7
2010/04/08 12:35:59 [debug] 1984#3556: *1 access phase: 8
2010/04/08 12:35:59 [debug] 1984#3556: *1 access phase: 9
2010/04/08 12:35:59 [debug] 1984#3556: *1 post access phase: 10
2010/04/08 12:35:59 [debug] 1984#3556: *1 http client request body preread 111
2010/04/08 12:35:59 [debug] 1984#3556: *1 http init upstream, client timer: 0
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "X-Real-IP: "
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script var: "192.168.21.58"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "
"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "Host: "
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script var: "jupiter:8882"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "
"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "X-Forwarded-For: "
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script var: "192.168.21.58"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "
"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http script copy: "Connection: close
"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Accept-Language: ru,en-us;q=0.7,en;q=0.3"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Accept-Encoding: gzip,deflate"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Referer: http://jupiter:8882/hmao/"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Cookie: JSESSIONID=570B6C3B0EB5B5125408180E537A984D"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Pragma: no-cache"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Cache-Control: no-cache"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Content-Type: application/x-www-form-urlencoded"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header: "Content-Length: 111"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http proxy header:
"POST /hmao/admin/access_denied.htm HTTP/1.0
X-Real-IP: 192.168.21.58
Host: jupiter:8882
X-Forwarded-For: 192.168.21.58
Connection: close
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ru,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Referer: http://jupiter:8882/hmao/
Cookie: JSESSIONID=570B6C3B0EB5B5125408180E537A984D
Pragma: no-cache
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
Content-Length: 111

"
2010/04/08 12:35:59 [debug] 1984#3556: *1 http cleanup add: 0078B040
2010/04/08 12:35:59 [debug] 1984#3556: *1 get rr peer, try: 1
2010/04/08 12:35:59 [debug] 1984#3556: *1 socket 336
2010/04/08 12:35:59 [debug] 1984#3556: *1 connect to 192.168.20.70:8180 <http://192.168.20.70:8180>, fd:336 #2

2010/04/08 12:35:59 [debug] 1984#3556: *1 select add event fd:336 ev:0
2010/04/08 12:35:59 [debug] 1984#3556: *1 select add event fd:336 ev:1
2010/04/08 12:35:59 [debug] 1984#3556: *1 http upstream connect: -2
2010/04/08 12:35:59 [debug] 1984#3556: *1 event timer add: 336: 60000:3700467006
2010/04/08 12:35:59 [debug] 1984#3556: *1 http finalize request: -4, "/hmao/admin/access_denied.htm?" a:1, c:2
2010/04/08 12:35:59 [debug] 1984#3556: *1 http request count:2 blk:0
 


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

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


 




Copyright © Lexa Software, 1996-2009.