- 论坛徽章:
- 20
|
本帖最后由 baby_神 于 2016-08-25 05:13 编辑
http {
include mime.types;
default_type application/octet-stream;
access_log /dev/null;
sendfile on;
keepalive_timeout 65;
tcp_nodelay on;
client_body_temp_path /tmp/nginx_client_body_temp;
proxy_temp_path /tmp/nginx_proxy_temp;
server {
listen 1.1.1.1:80;
listen 2.2.2.2:80;
listen 3.3.3.3:80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
include vhosts/*.location;
}
include vhosts/*.server;
}
文件内容如上:
需求:在server {} 这个块的后面追加一行内容,内容为“include vhosts/dns.conf;” 中间有其他花括号对,数量不一定是两个。
结果为
...
...
root html;
}
include vhosts/*.location;
}
include vhosts/dns.conf;
include vhosts/*.server;
}
|
|