当前位置:Gxlcms > PHP教程 > Nginx配置虚拟机

Nginx配置虚拟机

时间:2021-07-01 10:21:17 帮助过:13人阅读

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;

}

}


版权声明:本文为博主原创文章,未经博主允许不得转载。

以上就介绍了Nginx 配置虚拟机,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

人气教程排行