设置nginx支持虚拟机,支持多域名多网站
2014-12-02 21:18
288 查看
编辑nginx.conf 文件 调整http
http {
#第一域名站
server {
listen 80;
server_name www.domain1.com;
access_log logs/domain1.access.log main;
location / {
index index.php index.html index.htm;
root /var/www/domain1.com/htdocs;
}
location ~\.php$ {
root /var/www/domain1.com/htdocs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME scripts_path$fastcgi_script_name;
include fastcgi_params;
}
}
server { listen 80;#设置侦听的端口 server_name www.host2.com host2.com; //域名 access_log logs/host2.access.log main; //错误日志 location / { index index.php index.html;//首页索引文件 root /var/www/host2/; //网站根目录 } } }
http {
#第一域名站
server {
listen 80;
server_name www.domain1.com;
access_log logs/domain1.access.log main;
location / {
index index.php index.html index.htm;
root /var/www/domain1.com/htdocs;
}
location ~\.php$ {
root /var/www/domain1.com/htdocs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME scripts_path$fastcgi_script_name;
include fastcgi_params;
}
}
server { listen 80;#设置侦听的端口 server_name www.host2.com host2.com; //域名 access_log logs/host2.access.log main; //错误日志 location / { index index.php index.html;//首页索引文件 root /var/www/host2/; //网站根目录 } } }
相关文章推荐
- apache主机头设置-一台服务器支持多个网站,多个域名 ... [复制链接]
- 网站域名设置IIS支持flv的视频格式
- 服务器网站主机头设置及域名DNS解析
- 局域网网站域名访问设置
- Nginx默认网站的设置
- nginx多域名设置
- nginx多域名设置
- 多个网站域名使用同一个IP的设置
- [转]nginx多域名设置
- Nginx网站服务器设置反向代理
- 设置网站只能通过域名访问,不能通过IP访问
- ubuntu12.04 虚拟机 编译安装nginx 1.3.6 搭建支持flv mp4 流媒体服务器
- 设置Exchange 2003的多域名支持
- 合理设置域名TTL值给网站加速
- 我的网站新增加了个域名,谢谢大家对我的支持
- 设置nginx防止别人的域名绑定你的主机
- 让你的网站支持IE 8:使用X-UA-Compatible来设置IE8兼容模式
- Nginx对于cname的域名跳转,虚拟机的调整
- asp 设置只能指定域名可以使用此网站
- 服务器数据库系列 - Nginx 虚拟机设置