Window下配置:
server {
listen 80;server_name blog.com www.blog.com;
root E:/phpStudy/WWW/yii_blog/3 ;
location / {
index index.html index.php;
}
location ~* \.(gif|jpg|png)$ {
expires 30d;
}
location ~ \.php$ {
fastcgi_pass localhost:9000;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Linux下配置:
server{
listen 80;
root /home/user/website/www;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files
$uri
$uri
/ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/user/website/www
$fastcgi_script_name
;
include
/etc/nginx/fastcgi_params;
}
}