migrating from lighttpd to nginx

I am migrating my server from lighttpd to nginx, in lighttpd I used to put fast cgi configuration in one file called fastcgi.conf. As I have multiple subdomains, do i need to put mentioned configuration for every virtual host in nginx.


    location ~ .php$ {
                    include fastcgi_params;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                    fastcgi_intercept_errors on;
                    fastcgi_pass unix:/var/run/php-fpm.sock;

And restart both the service of nginx and php-fpm.


First of all you are missing a }

If you want to include this block you can put it in any file /etc/nginx/fastcgi.conf for example, and include it in vhosts using a normal include.

server {
  server_name blabla;
  location / {
    # bla bla
  }
  include /etc/nginx/fastcgi.conf;
}
链接地址: http://www.djcxy.com/p/32422.html

上一篇: 使用Nginx + PHP访问被拒绝(403)PHP文件

下一篇: 从lighttpd迁移到nginx