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:
[code]
<Connector port="8180" URIEncoding="UTF-8" address="111.222.33.44" maxThreads="75"
protocol="HTTP/1.1"
maxSpareThreads="25" acceptCount="100"
debug="0" connectionTimeout="20000" disableUploadTimeout="true"
proxyPort="80" proxyName="dspace.example.com" />
[/code]
and here's my nginx virtualhost configuration
[code]
server {
listen 111.222.33.44:80;
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_pass http://111.222.33.44:8180/dspace/;
proxy_redirect http://111.222.33.44:8180/dspace/ 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;
}
}
[/code]
If you can shed any light on this problem, I would be most grateful!
Thanks,
-Andrew
Edited 1 time(s). Last edit at 12/13/2009 10:34PM by ahankinson.