nginx with data compression on java applet

hirantha hirantha at
Fri Mar 13 23:41:38 MSK 2009


I am very new to nginx, and I found the nginx is the perfect tool for me 
to do reverse-proxy while compressing the data. I have successfully 
configured the proxy_pass and gzip configurations and it is working as I 
expected in test environments.

We have web servers which streaming text data through java applet to the 
end users. Nginx is act as a reverse-proxy for back-end web servers; 
once the java applet loaded on the FireFox or IE browser it keep 
receiving data without any issue. But the problem is those text data 
won't get compressed though text, images etc loaded to the browser get 
compressed. I can compress data off the applet but once it send it to 
java applet, won't get compressed.

Here is my nginx.conf:

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
# compression
    gzip on;
    gzip_http_version 1.0;
    gzip_comp_level 4;
    gzip_proxied private;
    gzip_min_length  1100;
    gzip_buffers 16 8k;
    gzip_types text/plain text/html text/css application/x-javascript \
        text/xml application/xml application/xml+rss text/javascript \
        image/gif image/jpeg image/png;
    gzip_disable "MSIE [1-6].(?!.*SV1)";
    gzip_vary on;
    server {
        listen       80;
        server_name  localhost;

    location / {
        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;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        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;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;


I'm Running on FreeBSD7.1 and I googled such scenario but no luck. To 
get this done where do I have to looking in to..? Any advice is really 

Thanks in advance

More information about the nginx mailing list