Forum: NGINX ask help for nginx and tomcat

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
niedh (Guest)
on 2009-06-03 09:33
(Received via mailing list)
Hi everybody,
 I'm new to nginx. Recently I use comet in my project. I choose tomcat
for the java server. and enable the Http11NioProtocol connector.
 client send a ajax request,and the server side suspend it, and set a
timeout(5 seconds),when timeout reach,the tomcat end the response
 in tomat server.xml
   <Connector port="9090"
protocol="org.apache.coyote.http11.Http11NioProtocol"
              connectionTimeout="20000"
              redirectPort="8443" />

 when I test with tomcat directly,  means http://localhost:8080/xxxxx,
it works as what I expect,
 but when I use nginx to proxy, when the timeout reach,the tomcat server
end the response,but the request still there,
 nginx wait for its own "request timeout"(I don't what to call it).
 in nginx.conf,I set the follow proxy-relative config
       proxy_buffering          off;
       proxy_redirect          off;
       proxy_set_header        Host            $host;
       proxy_set_header        X-Real-IP       $remote_addr;
       proxy_set_header        X-Forwarded-For
$proxy_add_x_forwarded_for;

is there something i missed ? Any suggestion will be    appreciate..
thanks
Claude B. (Guest)
on 2009-06-03 12:22
(Received via mailing list)
Please don't send twice.

On Wed, Jun 3, 2009 at 7:23 AM, niedh <removed_email_address@domain.invalid> 
wrote:

>
>      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
>
> is there something i missed ? Any suggestion will be    appreciate.. thanks
>
>


--

George Bernard
Shaw<http://www.brainyquote.com/quotes/authors/g/george...
- "A government that robs Peter to pay Paul can always depend on the
support of Paul."
Claude B. (Guest)
on 2009-06-03 16:14
(Received via mailing list)
Can you tie Tomcat to Apache and use Nginx as a front end proxy?  Would
that
be easier to manage since Tomcat is built for Apache?

On Wed, Jun 3, 2009 at 10:12 AM, Claude B. 
<removed_email_address@domain.invalid> wrote:

>> in tomat server.xml
>> in nginx.conf,I set the follow proxy-relative config
>
>
> --
>
> George Bernard 
Shaw<http://www.brainyquote.com/quotes/authors/g/george... - "A government 
that robs Peter to pay Paul can always depend on the
> support of Paul."




--

H. L. Mencken
<http://www.brainyquote.com/quotes/authors/h/h_l_me...
- "Nobody ever went broke underestimating the taste of the American
public."
Arvind Jayaprakash (Guest)
on 2009-06-20 20:35
(Received via mailing list)
On Jun 03, niedh wrote:
>
>       proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
>
> is there something i missed ? Any suggestion will be    appreciate.. thanks

Try this:
http://wiki.nginx.org/NginxHttpCoreModule#keepalive_timeout
This topic is locked and can not be replied to.