0

I'm using resin(tomcat) back in nginx(apache) parse JSP file only,like this:

        location ~ \.jsp {
            // 88 is resin(tomcat) port
            proxy_pass   http://localhost:88; 
        }

should I activate keepalive in resin(tomcat)?

Koerr
  • 511
  • 1
  • 5
  • 11

1 Answers1

1

No, well you can, but it would be pointless.

NGINX doesn't support keep-alive to backend servers.

It is an HTTP/1.0 proxy without the ability for keep-alive requests yet. (As a result, backend connections are created and destroyed on every request.) Nginx talks HTTP/1.1 to the browser and HTTP/1.0 to the backend server. As such it handles keep-alive to the browser.

(NGINX Wiki)

If you're going to enable keep-alive do it in NGINX to the client, enabling it on the Tomcat side won't do anything if NGINX is sitting in front

  • recent versions of (`nginx` >= 1.1.4) support persistent connections with backend – SaveTheRbtz Dec 03 '11 at 14:10
  • @SaveTheRbtz The latest stable release is 1.0.10, 1.1.4 does support it but it's 1) not yet (fully) documented and 2) development so shouldn't be used in production. Though it has interesting potential –  Dec 05 '11 at 09:20
  • Untested software should not be used in production. If it passed tests is there any reason not to use it in production? Difference between production and development versions is pretty ambiguous. – SaveTheRbtz Dec 05 '11 at 18:44
  • @SaveTheRbtz If I was even caught using development versions of software I'd be screwed, let alone if something went wrong. Development is probably fine for home servers, playing around and small companies, but regardless the actual differences, when dealing with enterprise, unless it's "stable", using it in production is a definite no. In fact, we can only install software on our servers that has been out and stable with no un-patched, known bugs for 6 months. –  Dec 05 '11 at 22:08