Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are there any general optimizations for this sort of setup? I read something about nginx not using the most recent protocol in http, so are there things that I could tune apache for? Also, is there relationships between the keepalive attributes of each webserver or maxconnections and such?

I'd hate to optimize one the correct way and have the other stopping those optimizations from meaning anything.

Where do I start?

share|improve this question
up vote 0 down vote accepted

If you're proxying traffic to apache from nginx then the only place you need to worry about keepalives is in nginx. Nginx serves HTTP/1.1 to clients, but can only proxy HTTP/1.0, which doesn't support keepalive so there'll be no keepalive between apache and nginx.

Nginx will run several thousand connections without blinking, so start with setting a nice high keepalive timeout and reduce it if necessary.

The main issue you need to look at when configuring is that both apache and nginx can handle enough simultaneous connections - depending on your setup, you'll require several times the number of nginx connections to apache connections.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.