nginx虚拟主机配置文件(*.conf)

在nginx.conf 的http 块下最后添加一句引用:

http {
    .....
    include vhosts.conf;
    #或者引用一下目录 
    include conf.d/*.conf;
}

vhosts.conf

server {
    listen       80;
    server_name  lren.org;

    location / {
        root   d:/webroot/lren;
        index  index.html index.htm;
    }
}