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

We have a current, soon-to-be legacy PHP app installed in production, served with apache. Working fine.

Currently trying to add in new Node.js alpha stack, which we're planning to install alongside live framework for awhile to test (on a staging server, not production -- for now).

We're going to be using nginx as a frontend to node and a couple other services in the new environment. Also, need to continue serving old php app too for now -- through nginx (instead of apache).

My questions:

  1. Any real-world production tips in setting up nginx as an efficient reverse proxy for services like this? It seems so straightforward to me and seems to be working exactly as intended -- but I've been an apache guy forever so I just want to be sure I'm not overlooking anything security-wise, performance wise, etc.

  2. Anything I should look out for when switching from the apache-backed PHP, to php-fpm, to serve an existing app? I've never used this flavor of php before, but it looks like the best way to do this through nginx. All of the obvious ini values ported over, but I still feel like I might be missing something.

share|improve this question
  1. nginx works pretty well out the box. The normal performance considerations of compression, Expires headers and serving static content directly still apply. The only real performance options for nginx are the worker_process and worker_connections options.

  2. I haven't used PHP-FPM myself, so I don't know how much it differs from standard PHP over FastCGI (under nginx). If the PHP setup is temporary I would probably go for standard PHP over FastCGI.

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.