1
votes

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.

1

1 Answers

1
votes

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;
}