ThttpdCGI

Nginx doesn't serve CGI scripts. While there's all sorts of hacks to work around this, none of them are really satisfactory or general-purpose.

Thttpd is a *very* simple (and very small footprint) HTTP server that includes CGI support. It's a good solution if you need CGI support. Simply proxy to it from Nginx for all your CGI needs.

If you decide to go this route, you should probably build thttpd from source and apply the patch found here.

/etc/thttpd.conf (this is just an example): host=127.0.0.1 port=8000 user=thttpd logfile=/var/log/thttpd.log pidfile=/var/run/thttpd.pid dir=/var/www cgipat=**.cgi|**.pl
 * 1) BEWARE : No empty lines are allowed!
 * 2) This section overrides defaults
 * 3) This section _documents_ defaults in effect
 * 4) port=80
 * 5) nosymlink         # default = !chroot
 * 6) novhost
 * 7) nocgipat
 * 8) nothrottles
 * 9) host=0.0.0.0
 * 10) charset=iso-8859-1

For a more detailed example, see the Mailman entry on the Nginx wiki.

/etc/nginx.conf: location /cgi-bin { include proxy.conf; proxy_pass http://127.0.0.1:8000; }