nginx使用include配置多虚拟主机
2014-05-05 15:32
246 查看
####设置http服务器
http {
####文件扩展名与文件类型映射表
include mime.types;
####默认文件类型
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#虚拟主机
server {
listen 8081;
server_name localhost;
charset utf-8;
# access_log logs/aa.access.log info;
location / {
root html/aa;
index index.html index.htm;
}
}
server{
listen 8082;
server_name localhost;
charset utf-8;
# access_log logs/bb.access.log info;
location / {
root html/bb;
index index.html;
}
}
include /usr/local/nginx/conf/vhosts/*;
}
http {
####文件扩展名与文件类型映射表
include mime.types;
####默认文件类型
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#虚拟主机
server {
listen 8081;
server_name localhost;
charset utf-8;
# access_log logs/aa.access.log info;
location / {
root html/aa;
index index.html index.htm;
}
}
server{
listen 8082;
server_name localhost;
charset utf-8;
# access_log logs/bb.access.log info;
location / {
root html/bb;
index index.html;
}
}
include /usr/local/nginx/conf/vhosts/*;
}
相关文章推荐
- 学习淘淘商城第七十四课(学习nginx配置及举例使用端口、域名来区分不同的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- 如何在已有网站的服务器上面,通过nginx配置虚拟主机来达到多个应用使用同一个服务器的效果
- Nginx虚拟主机配置教程
- NGINX:虚拟主机配置
- nginx/windows: nginx多虚拟主机配置
- Nginx虚拟主机配置教程【1】
- Nginx安装与配置:默认虚拟主机、用户认证和域名重定向
- Nginx配置虚拟主机
- LAMP架构(nginx安装,默认虚拟主机,用户认证,域名重定向,nginx配置文件详解)
- Nginx配置虚拟主机(二)
- 使用virtualbox 配置 linux host-only虚拟主机连接外网(转载)
- Nginx配置多个基于域名的虚拟主机+实验环境搭建+测试
- nginx的配置、虚拟主机、负载均衡和反向代理--01
- Nginx虚拟主机配置教程