# Problems using tomcat as a backend

**URL:** <https://www.ruby-forum.com/t/problems-using-tomcat-as-a-backend/188871>\
**Category:** NGINX\
**Created:** [May 19, 2010, 6:15pm UTC](https://www.ruby-forum.com/t/problems-using-tomcat-as-a-backend/188871 "2010-05-19T18:15:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davide\_DSAmico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@Davide\_DSAmico](https://www.ruby-forum.com/u/Davide_DSAmico)\
**Post date:** [May 19, 2010, 6:15pm UTC](https://www.ruby-forum.com/t/problems-using-tomcat-as-a-backend/188871/1 "2010-05-19T18:15:21Z")

</div>

Hi,  
i’m using nginx 0.8.37 to proxy an ssl site on a tomcat backend  
(teamwork application).  
When I try to download a file using MSIE 8, I see the error:  
“Internet Explorer cannot download YYYYYY from tw.xxxxxxx.it”

Searching on internet it seems the same problem as in this old post:  
[http://www.ruby-forum.com/topic/160290](http://www.ruby-forum.com/topic/160290)

This is my vhost config:  
upstream teamwork {  
server 172.16.16.132:8080;  
server 127.0.0.1:8080 backup;  
}

server {  
ssl on;  
ssl\_certificate /usr/local/etc/nginx/conf/cert.pem;  
ssl\_certificate\_key /usr/local/etc/nginx/conf/cert.key;  
keepalive\_timeout 70;  
access\_log /var/log/nginx/tw-access.log;  
error\_log /var/log/nginx/tw-error.log;

listen 172.16.16.221:443;  
server\_name tw.xxxxxx.it;  
proxy\_read\_timeout 360;

```
     proxy_set_header Host $host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For 

```

$proxy\_add\_x\_forwarded\_for;

location / { proxy\_pass [http://teamwork](http://teamwork); }  
}

server {  
listen 172.16.16.221:80;  
server\_name tw.xxxxxx.it;  
rewrite ^(.\*) [https://tw.xxxxxx.it$1](https://tw.xxxxxx.it$1) permanent;  
access\_log /var/log/nginx/tw-access.log;  
error\_log /var/log/nginx/tw-error.log;

}

This is my nginx config:

worker\_processes 1;

events {  
worker\_connections 1024;  
}

http {  
server\_names\_hash\_bucket\_size 64;

```
 include /usr/local/etc/nginx/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 /var/log/nginx/access.log;
 error_log /var/log/nginx/error.log;

 # spool uploads to disk instead of clobbering downstream servers
 client_body_temp_path /var/spool/nginx-client-body 1 2;
 client_max_body_size 32m;
 client_body_buffer_size 128k;

 server_tokens off;

 sendfile on;
 tcp_nopush on;
 tcp_nodelay off;

 keepalive_timeout 5;

 ## Compression
 # Some version of IE 6 don't handle compression well on some

```

mime-types,  
# so just disable for them  
# Set a vary header so downstream proxies don’t send cached gzipped  
# content to IE6

```
 # proxy settings
 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;
 proxy_max_temp_file_size 0;

 proxy_connect_timeout 90;
 proxy_send_timeout 90;
 proxy_read_timeout 90;

 proxy_buffer_size 4k;
 proxy_buffers 4 32k;
 proxy_busy_buffers_size 64k;
 proxy_temp_file_write_size 64k;

 include /usr/local/etc/nginx/sites/*;

```

}

---

<div class="post-metadata">

**Author:** ![Davide\_DSAmico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@Davide\_DSAmico](https://www.ruby-forum.com/u/Davide_DSAmico)\
**Post date:** [May 21, 2010, 1:07am UTC](https://www.ruby-forum.com/t/problems-using-tomcat-as-a-backend/188871/2 "2010-05-21T01:07:37Z")

</div>

> but there is a Vary header present, the old thread mentions that might  
> be an issue.
> 
> We download files using IE8 via an nginx-\>Tomcat configuration all the  
> time, and no problems, so it must be something application-specific.
> 
> –  
> RPM

Well, I tried to download using MSIE 8 and http protocol and I had no  
problem at all.  
So I started to think that this ‘behaviour’ is related to MSI8+SSL and  
in fact I discovered that if I use a expires 0; in vhost configuration,  
everything is fine using https.

My .2 cents 🙂

d.

---

<div class="post-metadata">

**Author:** ![Davide\_DSAmico](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/eb9ed0/32.png) [@Davide\_DSAmico](https://www.ruby-forum.com/u/Davide_DSAmico)\
**Post date:** [May 19, 2010, 11:46pm UTC](https://www.ruby-forum.com/t/problems-using-tomcat-as-a-backend/188871/3 "2010-05-19T23:46:45Z")

</div>

On Wed, May 19, 2010 at 11:14 AM, Davide D’Amico  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,  
> i’m using nginx 0.8.37 to proxy an ssl site on a tomcat backend (teamwork  
> application).  
> When I try to download a file using MSIE 8, I see the error:  
> “Internet Explorer cannot download YYYYYY from tw.xxxxxxx.it”

Have you tried a tool like [www.fiddler2.com](http://www.fiddler2.com) to see what IE8 is  
actually getting back from nginx? If it is getting the entire file,  
but there is a Vary header present, the old thread mentions that might  
be an issue.

We download files using IE8 via an nginx-\>Tomcat configuration all the  
time, and no problems, so it must be something application-specific.

–  
RPM
