码迷,mamicode.com
首页 > 其他好文 > 详细

Nginx配置虚拟主机

时间:2019-11-30 00:09:43      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:agent   serve   mil   war   lis   remote   time   access   list   

以hostname区分不同的网站,一个server{ }配置块就是一个网站。

# 省略一些配置
......
http { include mime.types; default_type application/octet-stream; #log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘ # ‘$status $body_bytes_sent "$http_referer" ‘ # ‘"$http_user_agent" "$http_x_forwarded_for"‘; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name www.ccke.org; # 网站A
location / { root html; index index.php index.html; }
error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 80; server_name www.nmka.com; # 网站B
location / { root html; index index.html; }
error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
# 省略一些配置
...... }

 

Nginx配置虚拟主机

标签:agent   serve   mil   war   lis   remote   time   access   list   

原文地址:https://www.cnblogs.com/dgjnszf/p/11960667.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!