nginx的小总结(三)


nginx的小总结(三)
 
nginx的小总结(二)
http://www.2cto.com/os/201303/192107.html
nginx小总结,虚拟主机的配置
  www.2cto.com  
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 / {
 
                root   html; 
                index  index.html index.htm; 
                } 
        } 
        server { 
 
                listen       80; 
                server_name  qq.example.com; 
 
                location / { 
                root   example; 
                index  index.html index.htm; 
            } 
        } 
 
  
配置如上,还是比较容易理解的,只是多添加了一个server的区域,于是就有两个了,注意,这里本人使用的是相对路径!

相关内容

    暂无相关文章