首页 > 系统相关 >nginx

nginx

时间:2024-10-16 17:19:43浏览次数:3  
标签:index http server nginx html 服务器

1.1 什么是nginx?

  • http和https区别?
    • 七层
    • 三次握手
  • Nginx(发音同 engine x)是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行。由俄罗斯的程序设计师Igor Sysoev(伊戈尔·西索夫)所开发,供俄国大型的入口网站及搜索引擎Rambler(漫步者)(俄文:Рамблер)使用。其特点是占有内存少,并发能力强,事实上nginx的并发能力确实在同类型的网页服务器中表现较好,中国大陆使用nginx网站用户有:新浪、网易、 腾讯等。
  • nginx web服务器,但是不支持Java。支持前端
  • Web服务器 :
    • 前端项目nginx ????
  • 优点:
    • 占用内存少,并发能力强
    • Nginx专为性能优化而开发, 在高连接并发的情况下,能够支持高达 50,000 个并发连接数的响应
    • Nginx支持热部署, 可以在不间断服务的情况下,对软件版本进行升级.

1.2 应用场景

  1. http服务器: Nginx是一个http服务可以独立提供http服务。可以做网页静态服务器。
  2. 虚拟主机: 可以实现在一台服务器虚拟出多个网站。例如个人网站使用的虚拟主机。
  3. 反向代理,负载均衡 : 当网站的访问量达到一定程度后,单台服务器不能满足用户的请求时,需要用多台服务器集群可以使用nginx做反向代理。并且多台服务器可以平均分担负载,不会因为某台服务器负载高宕机而某台服务器闲置的情况。

2.3 Nginx安装

  • 下载nginx, 官方网站:nginx
  • 我们使用的版本是1.17.8版本

  • Nginx在Linux下安装,只提供了源代码,所以我们需要进行编译

2.3.1 安装环境配置

1.因为Nginx是C语言编写的,所以需要配置C语言编译环境 (一定要在联网状态下安装)

需要安装gcc的环境。执行命令:
yum install gcc-c++
  • 注意: 如果执行命令出现这样的提示:

  • 解决办法:
问题是 yum在锁定状态中,强制关掉yum进程即可
rm -f /var/run/yum.pid

 2.第三方的开发包, 在编译之前需要安装这些第三方包。

  • PCRE
    • nginx的http模块使用pcre来解析正则表达式,所以需要在linux上安装pcre库
安装命令:
yum install -y pcre pcre-devel
  • zlib
    • nginx使用zlib对http包的内容进行gzip,所以需要在linux上安装zlib库
安装命令:
yum install -y zlib zlib-devel
  • openssl
    • OpenSSL 是一个强大的安全套接字层密码库,nginx不仅支持http协议,还支持https,所以需要在linux安装openssl库。
安装命令:
yum install -y openssl openssl-devel

1.3.2 安装Nginx 步骤

1.将Nginx的源码包上传到 Linux

2.解压Nginx

tar -xvf nginx-1.17.8.tar

3.进入到解压之后的目录 nginx-1.17.8

 4.执行命令 configure,生成 Mikefile 文件

./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/temp/nginx/client \
--http-proxy-temp-path=/var/temp/nginx/proxy \
--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi
  • 执行命令后, 生成了MakeFile文件

 4.创建临时文件目录

mkdir /var/temp/nginx/client -p

5执行make命令,进行编译

make

 6.安装

make install

1.3.3 启动并访问 Nginx

 1.进入到nginx 安装目录

cd /usr/local/nginx/

 2.进入到 sbin目录,执行 nginx 命令

./nginx 启动
./nginx -s stop 关闭
ps aux | grep nginx 查看进程

 3.通过浏览器进行访问 ,默认端口 80 (注意:是否关闭防火墙。)

 systemctl stop firewalld  -- 关闭
 firewall-cmd --reload --刷新
 firewall-cmd --state --查看状态
 
 

2.4 配置虚拟主机

  • 虚拟主机指的是,在一台服务器中,我们使用Nginx,来配置多个网站.如何区分不同的网站:
  1. 端口不同
  2. 域名不同

2.4.1 通过端口区分不同的虚拟主机

  • Nginx配置文件
  1. Nginx配置文件的位置
cd /usr/local/nginx/conf
nginx.conf 就是Nginx的配置文件
  1. Nginx核心配置文件说明
worker_processes 1; #work的进程数,默认为1
#配置 影响nginx服务器与用户的网络连接
events {
    worker_connections 1024; #单个work 最大并发连接数
}
# http块是配置最频繁的部分 可以嵌套多个server,配置代理,缓存,日志定义等绝大多数功能
http {
    # 引入mime类型定义文件
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65; # 超时时间
    #server 配置虚拟主机的相关参数 可以有多个,一个server就是一个虚拟主机
    server {
        # 监听的端口
        listen 80;
        #监听地址
        server_name localhost; # 监听ip 
        # 默认请求配置
        location / {
            root html; # 默认网站根目录
        index index.html index.htm; # 欢迎页
        }
        # 错误提示页面
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        root html;
    }
  }
}

2.4.2.使用Notpad,连接Linux

  • 使用notepad++来连接linux,好处是使用notepad++来编辑linux中文件的批量文字,会比直接在linux中操作方便快捷很多.

 1.Notepad 插件中安装NppFTP

 2.打开NppFTP

 3.选择设置

 4.配置连接信息

 5.连接

2.4.3配置nginx.conf

 1.使用Notpad 在nginx.conf 中添加一个 新的server

worker_processes  1;



events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

 

    sendfile        on;
   
    keepalive_timeout  65;

  

    server {
        listen       80;
        server_name  localhost;

     

        location / {
            root   html;
            index  index.html index.htm;
        }

       
    }


 
}

 2.复制一份 html目录

cp -r html/ html81  :赋值目录

 3.重新加载配置文件

sbin/nginx -s reload

 4.访问

http://192.168.52.100 访问第一个server
http://192.168.52.100:81/ 访问第二个server

2.4.4通过域名区分不同的虚拟主机

  • 使用SwitchHosts,修改hosts

解压什么是域名

  • 域名级别
    • 一级域名
      • 比如 .com .org .cn
    • 二级域名
      • 二级域名是在一级域名前加一级
      • 二级域名: baidu.com , zhihu.com
    • 三级域名
  • 域名绑定
    • 一个域名对应一个ip地址,一个ip地址可以被多个域名绑定。
    • 通过 DNS服务器去解析域名
  • 配置域名映射

1.本地测试可以修改hosts文件。修改window的hosts文件:

(C:\Windows\System32\drivers\etc)

  • 可以配置域名和ip的映射关系,如果hosts文件中配置了域名和ip的对应关系,不需要走dns服务器
配置一下nginx的映射
192.168.52.100 www.ng.com

 2.使用SwitchHosts,修改hosts

  • 解压

  • 配置IP与域名的映射

  • 配置nginx.conf
     #通过域名区分虚拟主机
     server {
        listen 80;
        server_name www.t1.com;
        location / {
            root html-t1;
            index index.html index.htm;
      }
}
    server {
        listen 80;
        server_name www.t2.com;
        location / {
            root html-t2;
            index index.html index.htm;
     }
}
  • 创建 html-t1和 html-t2 目录
cp -r html html-t1
cp -r html html-t2

  • 修改一下index.html 中,刷新
sbin/nginx -s reload
  • 访问

  • 虽然只有一台服务器,但是这台服务器上运行着多个网站,访问不同的域名 就可访问到不同的网站内容

2.5 反向代理

2.5.1 什么是代理

  • 代理其实就是一个中介,A和B本来可以直连,中间插入一个C,C就是中介。刚开始的时候,代理多数是帮助内网 client 访问外网 server 用的

客户机在发送请求时,不会直接发送给目的主机,而是先发送给代理服务器,代理服务接受客户机请求之后, 再向主机发出,并接收目的主机返回的数据再发送给客户机

2.5.2 正向代理

  • 比如我们国内访问谷歌,直接访问访问不到,我们可以通过一个正向代理服务器,先将请求发送到到代理服,代理服务器能够访问谷歌,这样由代理去谷歌取到返回数据,再返回给我们,这样我们就能访问谷歌了
  • 正向代理代理的是客户端, 服务端不知道实际发起请求的客户端

2.5.3 反向代理

  • 反向代理和正向代理的区别就是:正向代理代理客户端,反向代理代理服务器。
  • 反向代理是指用代理服务器接收客户端的请求,然后将请求转发给网站内部应用服务器,并将从服务器上得到的结果返回给客户端.

2.5.4 Nginx实现反向代理

  • 准备:一个tomcat服务器(我们访问访问的是nginx,找tomcat)
    • 直接关闭防火墙
  • 在nginx进行请求转发的配置


worker_processes  1;




events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

 

    sendfile        on;
 
    keepalive_timeout  65;

   
   # 一个server 代表一个虚拟机

    server {
        listen       80;
        server_name  192.168.80.129;

       

        location / {
           # root   html;
			# 反向代理配置
			proxy_pass http://127.0.0.1:8080;
           # index  index.html index.htm;
        }

      
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

      
    }
	server {
        listen       81;
        server_name  localhost;

       

        location / {
            root   html81;
            index  index.html index.htm;
        }

      
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

      
    }


    

}
  • Nginx作为反向代理服务器安装在服务端,Nginx的功能就是把请求转发给后面的应用服务器

  • 配置步骤
    • 第一步:简单的使用2个tomcat实例模拟两台http服务器,分别将tomcat的端口改为8080和8081

第二步:启动两个tomcat

重命名tomcat,为了方便操作

mv old_folder new_folder

新建一个tomcat

 cp -r tomcat1 tomcat2
./bin/startup.sh
访问两个tomcat
http://192.168.52.100:8080/
http://192.168.52.100:8081/

 第三步,反向代理服务器配置

    #反向代理配置
    #upstream中的server是真正处理请求的应用服务器地址
    upstream easthome1{
        #用server定义HTTP地址
        server 192.168.52.100:8080;
    }
    server {
        listen 80;
        server_name www.easthome1.com;
        location / {
            # 利用 proxy_ pass可以将请求代理到upstream命名的HTTP服务
            proxy_pass http://easthome1; #转发到的地址
            index index.html index.htm;
        }
    }
    upstream easthome2{
        #用server定义HTTP地址
        server 192.168.52.100:8081;
    }
    server {
        listen 80;
        server_name www.easthome2.com;
        location / {
            proxy_pass http://easthome2;
            index index.html index.htm;
        }
}

第四步,nginx重新加载配置文件 

nginx -s reload

第五步:配置域名,在hosts文件中增加域名和ip的映射文件 

通过浏览器输入域名, 访问Nginx代理服务器, Nginx根据域名将请求转发给对应的目标服务器,作为

用户我们看到的是服务器的响应结果页面,在整个过程中目标服务器相对于客户端是不可见的,服务

端向外暴露的就是Nginx的地址.

配置实例1.2

  • localhost:8001/edu/ --- >127.0.0.1:80801
  • localhost:8001/pro/ --- > 127.0.0.1:8082

步骤:

  1. 两个tomcat和测试页面
    1. 重点需要动tomcat02配置

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8091" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the
         AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
         This connector uses the APR/native implementation which always uses
         OpenSSL for TLS.
         Either JSSE or OpenSSL style configuration may be used. OpenSSL style
         configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
                         certificateFile="conf/localhost-rsa-cert.pem"
                         certificateChainFile="conf/localhost-rsa-chain.pem"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector protocol="AJP/1.3"
               address="::1"
               port="9001"
               redirectPort="8443" />
    -->

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

2.6 负载均衡

2.6.1 什么是负载均衡

  • 当一个请求发送过来的时候,Nginx作为反向代理服务器,会根据请求找到后面的目标服务器去处理请求,这就是反向代理. 那么, 如果目标服务器有多台的话,找哪一个服务器去处理当前请求呢 ? 这个合理分配请求到服务器的过程就叫做负载均衡.

2.6.2 为什么用负载均衡

  • 当系统面临大量用户访问,负载过高的时候,通常会使用增加服务器数量来进行横向扩展, 负载均衡主要是为了分担访问量,将请求合理分发给不同的服务器, 避免临时的网络堵塞

2.6.3 负载均衡策略

2.6.3.1 轮询

  • 默认策略, 每个请求按照时间顺序逐一分配到不同的服务器,如果某一个服务器下线,能自动剔除配置方式
    #负载均衡
    upstream easthomeServer{
        # 用server定义 HTTP地址
        server 192.168.52.100:8081;
        server 192.168.52.100:8082;
    }
    server {
         listen 80;
         server_name www.easthomeNB.com;
         location / {
            # 利用 proxy_ pass可以将请求代理到upstream命名的HTTP服务
            proxy_pass http://easthomeServer;
            index index.html index.htm;
        }
}
    #负载均衡
    upstream easthomeServer{
        # 用server定义 HTTP地址
        server 192.168.52.100:8081;
        server 192.168.52.100:8082;
    }
    server {
         listen 80;
         server_name www.easthomeNB.com;
         location / {
            # 利用 proxy_ pass可以将请求代理到upstream命名的HTTP服务
            proxy_pass http://easthomeServer;
            index index.html index.htm;
         }
}

2.6.3.2 weight

  • 可以根据服务器的实际情况调整服务器权重。权重越高分配的请求越多,权重越低,请求越少。默认都是1
#负载均衡
upstream easthomeServer{
    # 用server定义 HTTP地址
    server 192.168.52.100:8081 weight=1;
    server 192.168.52.100:8082 weight=10;
}

标签:index,http,server,nginx,html,服务器
From: https://blog.csdn.net/m0_73757039/article/details/142985876

相关文章

  • ELK实时监控Nginx日志
    ELK分析Nginx日志和可视化展示一、概述使用ELK收集nginxaccess日志,利用Grafana做出一套可视化图表二、环境准备环境说明操作系统:centos7.6docker版本:19.03.12ip地址:192.168.31.196elk搭建关于elk的搭建,请参考以下3篇文章:docker安装elasticsearch和head插件docker安......
  • 122-bt-nginx 配置备份
    userwwwwww;worker_processesauto;error_log/www/wwwlogs/nginx_error.logcrit;pid/www/server/nginx/logs/nginx.pid;worker_rlimit_nofile51200;stream{log_formattcp_format'$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_......
  • Nginx UI:全新的 Nginx 在线管理平台
    前言Nginx在程序部署中扮演着至关重要的角色,其高性能、高安全性、易于配置和管理的特点,使得它成为现代Web应用部署中不可或缺的一部分。今天大姚给大家分享一款实用的NginxWebUI工具,希望能够帮助到有需要的同学。工具介绍NginxUI一个功能丰富、易于使用的NginxWebUI工具,它......
  • Nginx UI:全新的 Nginx 在线管理平台
    前言Nginx在程序部署中扮演着至关重要的角色,其高性能、高安全性、易于配置和管理的特点,使得它成为现代Web应用部署中不可或缺的一部分。今天大姚给大家分享一款实用的NginxWebUI工具,希望能够帮助到有需要的同学。工具介绍NginxUI一个功能丰富、易于使用的NginxWebUI工......
  • nginx web代理
    目录1.nginx的简单介绍2.正向代理的应用场景2.1做访问控制 2.2审计 2.3负载分散2.4隐私保护和匿名性3.反向代理的应用场景如下 3.1.负载均衡2.缓存静态内容3.压缩和优化内容4.提供故障转移5.安全性和匿名性4.正向代理 4.1web端4.2lb01代理服务器配置 5.反......
  • Nginx
    apt-getupdateapt-getinstallnginxsudosystemctlstartnginxsudosystemctlstatusnginx出现以下界面代表启动成功,如果出现图二,就修改文件权限sudochownnginx:nginx/run/nginx.pidsudochmod644/run/nginx.pid查看防火墙状态ufwstatusstatus:inactive代表......
  • 如何在 Ubuntu 16.04 上将 Nginx 网站根目录移动到新位置
    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站。简介在Ubuntu上,默认情况下,Nginxweb服务器将其文档存储在/var/www/html目录中,通常位于根文件系统与操作系统的其余部分一起。然而,有时将文档根目录移动到另一个位置会......
  • Docker-nginx数据卷挂载
    数据卷(volume)是一个虚拟目录,是容器内目录与宿主机目录之间映射的桥梁。以Nginx为例,我们知道Nginx中有两个关键的目录:html:放置一些静态资源conf:放置配置文件如果我们要让Nginx代理我们的静态资源,最好是放到html目录;如果我们要修改Nginx的配置,最好是找到conf下的nginx.conf文件......
  • datart前端单独部署到nginx
    这里假设你的本地可以正常跑起来前端项目,服务器为centos7且已经部署了nginx构建前端工程(frontend文件夹下是前端工程)npmrunbuild:all将构建出来的build文件夹放到服务器一个路径下配置nginx.conf,这里只写了http节点下的server节点怎么配置server{listen3000;......
  • nginx搭建视频下载站
    目录1.前言与介绍 2.atuoindex模块介绍 3.主要的功能 4.下载站基本要求5.具体配置6.做完如上的配置重载服务 7.创建密码文件 8.在windows主机上做域名解析 9.查看统计结果1.前言与介绍 前面的学习中根据nginx的简单的配置实现了根据IP端口和域名实现......