Welcome! Log In Create A New Profile


Tomcat pauses when proxied by NginX

Posted by ahankinson 
Tomcat pauses when proxied by NginX
December 13, 2009 10:34PM
Hi all,

I'm seeing some strange behaviour with Tomcat and NginX. I have NginX set up to be a proxy to Tomcat, running on port 8180.

What's happening is that it works great until I upload a file. The file uploads immediately, but Tomcat doesn't return anything until exactly two minutes later, and then it continues normally. (Upon a successful upload it continues to another page) It's not a slow connection, because I've monitored my network traffic in my browser, with no activity.

It seems like it's a Tomcat timeout issue, where it keeps a connection open. When it closes, NginX can finally continue on to the next page. I've tried setting just about all the timeouts I can think of, but I'm left scratching my head.

Here's the pertinent configuration parameters:

Tomcat's server.xml connector:
<Connector port="8180" URIEncoding="UTF-8" address="" maxThreads="75"
maxSpareThreads="25" acceptCount="100"
debug="0" connectionTimeout="20000" disableUploadTimeout="true"
proxyPort="80" proxyName="dspace.example.com" />


and here's my nginx virtualhost configuration
server {
server_name dspace.example.com;
access_log /var/log/httpd/dspace.example.com/access_log;
error_log /var/log/httpd/dspace.example.com/error_log;
root /webapps/dspace/webapps/;

server_name_in_redirect off;

location /dspace/ {
index index.jsp;
#proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect http://dspace.example.com/dspace/;

#proxy_redirect off;

#proxy_buffering off;
#proxy_store off;

#proxy_connect_timeout 60;
#proxy_send_timeout 30;
#proxy_read_timeout 30;
#rewrite ^/dspace/(.*)$ http://$host:8180/dspace/$1 permanent;


If you can shed any light on this problem, I would be most grateful!


Edited 1 time(s). Last edit at 12/13/2009 10:34PM by ahankinson.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
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