配置nginx状态信息虚拟主机

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置nginx状态信息虚拟主机相关的知识,希望对你有一定的参考价值。

[[email protected]]# cat>>nginx_vhosts.conf<<EOF

server

{

 listen 80;

 server_name status.etiantian.org;

 location /{

 stub_status on;

 access_log off;

  }

}

EOF

[[email protected]]# ../sbin/nginx -t

nginx: theconfiguration file /application/nginx-1.10.1/conf/nginx.confsyntax is ok

nginx:configuration file /application/nginx-1.10.1/conf/nginx.conftest is successful

[[email protected]]# ../sbin/nginx -s  reload

[[email protected]]# netstat -lnt  #或者 netstat -lnt|grep 80

Active Internetconnections (only servers)

Proto Recv-QSend-Q Local Address              Foreign Address            State     

tcp        0     0 0.0.0.0:892             0.0.0.0:*                   LISTEN     

tcp        0     0 0.0.0.0:2049                0.0.0.0:*                   LISTEN     

tcp        0     0 0.0.0.0:32803               0.0.0.0:*                   LISTEN     

tcp        0     0 127.0.0.1:199               0.0.0.0:*                   LISTEN     

tcp        0     0 0.0.0.0:875                 0.0.0.0:*                  LISTEN     

tcp        0     0 0.0.0.0:111                 0.0.0.0:*                   LISTEN     

tcp        0     0 0.0.0.0:80                  0.0.0.0:*                   LISTEN     

tcp        0     0 0.0.0.0:22                  0.0.0.0:*                   LISTEN     

tcp        0     0 0.0.0.0:59448               0.0.0.0:*                   LISTEN     

tcp        0     0 :::892                     :::*                        LISTEN     

tcp        0     0 :::2049                     :::*                        LISTEN     

tcp        0     0 :::32803                   :::*                        LISTEN     

tcp        0     0 ::ffff:127.0.0.1:8005      :::*                        LISTEN     

tcp        0     0 :::8009                    :::*                       LISTEN     

tcp        0     0 :::57707                   :::*                        LISTEN     

tcp        0     0 :::111                     :::*                        LISTEN     

tcp        0     0 :::8080                     :::*                        LISTEN     

tcp        0     0 :::22                      :::*     

hosts文件中解析了status.etinantian.org

192.168.47.133 www.etiantian.org  bbs.etiantian.org  blog.etiantian.org etiantian.org

192.168.47.133 status.etiantian.org

   技术分享


本文出自 “sky9890” 博客,请务必保留此出处http://sky9896.blog.51cto.com/2330653/1793453

以上是关于配置nginx状态信息虚拟主机的主要内容,如果未能解决你的问题,请参考以下文章

Ngingx常用配置虚拟主机,访问控制,认证和状态信息

Nginx相关安装功能开放(主配置文件修改)状态统计访问控制虚拟主机

Nginx虚拟主机配置实例

Nginx——nginx作为负载均衡服务(backup状态和down状态示例)

Nginx网站服务 配置

Nginx从入门到实战