nginx的小总结(三)
nginx小总结,虚拟主机的配置
user nginx nginx;
worker_processes 1;
events {
worker_connections 1024;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.example.com *.example.com;
location / {
root html;
index index.html index.htm;
}
}
server {
listen 80;
server_name qq.example.com;
location / {
index index.html index.htm;
}
}
server {
listen 80;
server_name qq.example.com;
location / {
root example;
index index.html index.htm;
}
}
}
配置如上,还是比较容易理解的,只是多添加了一个server的区域,于是就有两个了,注意,这里本人使用的是相对路径!
网页题目:nginx的小总结(三)
网页链接:http://tyjierui.cn/article/cjseie.html