欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

Nginx 配置虚拟机

程序员文章站 2022-05-11 09:13:04
...
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教程有兴趣的朋友有所帮助。

Nginx 配置虚拟机

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频