What is the best way to run PHP with Nginx?

  1. Run Nginx with PHP FastCGI
  2. Run Nginx as a reverse proxy while Nginx forwards request to Apache
  • It should read FastCGI instead of CGI. nginx supports CGI only through a hack (wiki.nginx.org/NginxSimpleCGI) at this time.
    – joschi
    Jun 25, 2010 at 16:23
  • Yeah should have told PHP FastCGI Updated; Thanks!
    – infynyxx
    Jun 25, 2010 at 20:10

2 Answers 2


If you need support for htaccess or any other Apache features, option 2, otherwise option 1.


I would say option one, and look into using php-fpm with nginx, it works great.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .