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
link|improve this question
It should read FastCGI instead of CGI. nginx supports CGI only through a hack (wiki.nginx.org/NginxSimpleCGI) at this time. – joschi Jun 25 '10 at 16:23
Yeah should have told PHP FastCGI Updated; Thanks! – infynyxx Jun 25 '10 at 20:10
feedback

2 Answers

up vote 6 down vote accepted

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

link|improve this answer
feedback

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

link|improve this answer
1  
+1 A helpful tutorial on the subject can be found on HowToForge - Installing PHP 5.3, Nginx And PHP-fpm On Ubuntu/Debian – wimvds Jul 8 '10 at 12:40
feedback

Your Answer

 
or
required, but never shown

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