nginx的小总结(三)

  • 来源:
  • 更新日期:2018-05-09

摘要:nginx小总结,虚拟主机的配置 user nginx nginx; worker_processes  1; events {     worker_connections  1024;     use  epoll; } http {     include       mime.types;     default_type  application/octet-stream;

nginx小总结,虚拟主机的配置

user nginx nginx;

002UASMrzy7605pjKJv15&690.jpg
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的区域,于是就有两个了,注意,这里本人使用的是相对路径!