server {
listen 80;
server_name www.shop.com;
location / {
index index.html;
root html/shop;
}
location ~ \.php$ {
root html/shop;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
测试:在根目录/usr/local/nginx/html/shop下创建index.html
在浏览器地址栏输入www.shop.com后,回车