Nginx + Glassfish breaks HTTP Headers?

I tried the following combinations

  1. Nginx + Mongrel (MRI)
  2. Nginx + Mongrel (Jruby)
  3. Nginx + Glassfish Gem
  4. Glassfish Gem

Basically for 1), 2) and 3) I use Nginx to service static files and
Mongrel/Glassfish to service rails with the following config

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

$proxy_add_x_forwarded_for;

With 1), 2) and 4) everything works fine,

However things start to break when I do 3) which is putting Nginx in
front of Glassfish Gem.

There appears to be some redundant stuffing of HTTP Headers, which
breaks all Ajax requests. The regular HTTP Get request work fine though.

But, when I remove Nginx to access Glassfish directly, then things are
fine.

At this point, 3) is my preferred deployment because Glassfish appears
to not suffer from the memory leak that Mongrel (Jruby) does, and I
need Nginx to service all other requests on this machine.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Sharkie,

Can you file a bug at:

https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT

and use “web_container” as the sub-component ?

This will make sure the right engineers in GlassFish team are looking at
it.

Thanks,
-Arun

Sharkie wrote:

      proxy_set_header   Host             $host;

http://xircles.codehaus.org/manage_email


Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Dear All,

I am suspecting that it’s not a BUG but rather a feature.

Glassfish uses:
Transfer-Encoding: chunked

Which is not use by Mongrel or anything else.

And NGINX does not handle it very well.

I guess I can either switch to Apache or try to disable this in
Glassfish. I would rather stick to the lightweightness of NGINX however.

Would you know how to turn off Transfer-Encoding: chunked?

On Aug 20, 2008, at 5:45 AM, Arun G. wrote:

Mongrel/Glassfish to service rails with the following config
But, when I remove Nginx to access Glassfish directly, then things
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I tried following the instruction by modifying domain.xml in the gem
folder. It did not work.

Is there a way to do this for the Glassfish Gem?

This would be very important to many Ruby on Rails users, as NGINX is
a historically popular front end for them, as opposed to Apache. Many
of Rails users still use NGINX + Mongrel or NGINX + Thin, as Apache is
sometime too thick for them.

Thanks

On Aug 21, 2008, at 4:01 AM, Arun G. wrote:

I am suspecting that it’s not a BUG but rather a feature.

Thanks,

    proxy_set_header   Host             $host;

things are fine.
Blog: http://blogs.sun.com/arungupta


Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Sharkie,

I filed the following issue to track it:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=5585

I’ll let you know once it’s resolved.

Thanks,
-Arun

Sharkie wrote:

Thanks

On Aug 20, 2008, at 5:45 AM, Arun G. wrote:

Mongrel/Glassfish to service rails with the following config
But, when I remove Nginx to access Glassfish directly, then things
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Sharkie,

This thread is followed at:

http://forums.java.net/jive/thread.jspa?messageID=294291&tstart=0

-Arun

Sharkie wrote:

Sharkie wrote:

With 1), 2) and 4) everything works fine,
To unsubscribe from this list, please visit:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs