nginx with data compression on java applet

Nick Pearson nick.pearson at gmail.com
Sat Mar 14 16:55:27 MSK 2009


My guess is that the Java applet isn't telling the server that it can accept
compressed content when it makes the requests to nginx.  Try configuring the
applet to tell the server to send gzipped content.  Note that it's possible
that Java applets may not be able to handle compressed content at all, in
which case it's a good thing that nginx is not making that assumption.

You should be able to watch the requests with Firebug in Firefox to see the
Accept-Encoding header.  If you can't see the Java applet requests with
Firebug (or another Firefox headers extension) you can use Ethereal or a
command-line tool on the client or server.

See section 14.3 of the W3's HTTP/1.1 Header Field Definitions page for more
info:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

On Fri, Mar 13, 2009 at 3:41 PM, hirantha <hirantha at securedpipe.net> wrote:

> Hi ALL,
>
> 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_pass         http://data.example.com/;
>       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
> appreciated
>
> Thanks in advance
> Hirantha
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090314/3ce44176/attachment.html>


More information about the nginx mailing list