<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                #### Nginx官網 ```shell www.nginx.org ``` #### Nginx的特點 - 擅長處理靜態小文件(1M) - 支持高并發(支持epoll模型) - 占用資源少 - 2W并發連接,10個進程,200M內存 - 配置簡單、靈活、輕量 - 功能豐富(Web、Proxy、Cache) - 工作在IOS第七層(支持限速、連接數限制等) #### Nginx基本功能 - 靜態服務(圖片、視頻、css、js、html) - 基于域名/IP/端口的虛擬主機 - Http/Https、SMTP、POP3反向代理 - TCP/UDP反向代理 - FastCGI、uWSGI反向代理 - 負載均衡 - 頁面緩存(CDN) - 支持gzip、expirse - URL Rewrite - 路徑識別 - 基于IP、用戶的訪問控制 - 支持訪問速率、并發限制 - 反向代理(適用2000WPV、并發連接1W/秒) #### Nginx原理 ##### master process 1. 與外界通訊和工作進程管理 2. 讀取nginx配置文件并驗證有效性 3. 建立、綁定和關閉Socket 4. 按照配置文件生成、管理和結束工作進程 5. nginx重啟、停止、重載配置文件、平滑升級、管理日志文件 ##### worker process 1. 接收客戶端請求,講請求交給各個功能模塊處理 2. 系統IO調用,獲取相應的數據,發送相應給客戶端 3. 數據緩存管理 4. 接收主進程指令,比如重啟、關閉 ##### 緩存索引重建及管理進程 cache模塊主要由緩存索引重建和緩存索引管理兩個進程完成,緩存索引重建進程是在nginx服務啟動一段時間后(默認1分鐘),由主進程生成,對本地磁盤的索引文件在內存中建立元數據,包括掃描、過期更新等操作,完成后退出 - 模塊只有使用時才加載 #### Nginx常用模塊 核心模塊 - Core functionality 標準模塊 - ngx_http_core_module - ngx_http_access_module - ngx_http_fastcgi_module - ngx_http_gzip_module - ngx_http_rewrite_module - ngx_http_upstream_module - ngx_http_proxy_module - ngx_http_limit_conn_module - ngx_http_limit_req_module - ngx_http_auth_basic_module - ngx_http_log_module - ngx_http_ssl_module - ngx_http_status_module - ngx_http_realip_module #### Nginx(Proxy)支持的算法 rr 輪詢 wrr 權重輪詢 iphash hash算法(解決session命中) urlhash hash算法 fair 動態算法(響應時間最短) ### Nginx部署(1.8.1) #### 安裝依賴 ```shell yum install openssl-devel pcre-devel pcre gcc zlib -y ``` - pcre 正則處理需要 - gcc 編譯需要 - zlib 壓縮需要 - openssl 安全鏈接需要 #### 編譯安裝 ```shell useradd nginx -s /sbin/nologin -M cd /opt && wget http://nginx.org/download/nginx-1.12.2.tar.gz tar xzf nginx-1.12.2.tar.gz && cd nginx-1.12.2 ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_geoip_module --with-stream --with-http_stub_status_module --with-http_realip_module make && make install ``` #### 基本操作 ```shell #啟動 /app/nginx/sbin/nginx #停止 /app/nginx/sbin/nginx -s stop # 檢查語法 /app/nginx/sbin/nginx -t #重啟 /app/nginx/sbin/nginx -s #重啟原理:生成基于新配置的線程,新請求轉發到新線程,舊線程處理完成后停止。 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看