Problems using tomcat as a backend

Davide D'Amico davide.damico at
Wed May 19 20:14:08 MSD 2010

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"

Searching on internet it seems the same problem as in this old post:

This is my vhost config:
upstream teamwork {
         server 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;

        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; }

server {
   rewrite ^(.*)$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 
     # 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/*;

More information about the nginx mailing list