Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

With apache ,I just put my binary under cgi-bin,how about nginx?

Does it support cgi at all?

share|improve this question

Nginx does not support CGI, because it does not spawn external processes. This is a design decision: Nginx is a high-performance web server and spawning an external process is rather expensive operation.

share|improve this answer
why support of cgi means spawn external processes? – kernel May 28 '11 at 8:41
@kernel because there's no way Nginx is going to embed a way to execute cgi. – Martin Fjordvald May 28 '11 at 9:43
why can't nginx use the same way as executing PHP to execute cgi? – kernel May 28 '11 at 9:45
@kernel CGI (Common Gateway Interface) implies a script is executed by an HTTP server (RFC 3875, section 3.4: Apache may execute a PHP script as CGI or using "mod_php" module (which is not CGI obviously) – Alexander Azarov May 28 '11 at 10:35

It does support FastCGI and UWSGI, though.

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.