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;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.