1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      Nginx服務(wù)優(yōu)化配置的示例分析

      這篇文章主要介紹了Nginx服務(wù)優(yōu)化配置的示例分析,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

      在尉犁等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供網(wǎng)站制作、網(wǎng)站設(shè)計 網(wǎng)站設(shè)計制作按需網(wǎng)站設(shè)計,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),高端網(wǎng)站設(shè)計,全網(wǎng)整合營銷推廣,外貿(mào)網(wǎng)站制作,尉犁網(wǎng)站建設(shè)費用合理。

      1、expires緩存模塊

      Nginx服務(wù)優(yōu)化配置的示例分析

      具體配置可參考官方文檔 http://nginx.org/en/docs/http/ngx_http_headers_module.html#expires

      [root@cairui conf]# cat nginx.conf | egrep -v "#|^$"
      user nginx;
      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;
          }
      location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|js|html|htm|css)$ {
         log_not_found off;
         expires 7d ;
         access_log off;
         proxy_store on;
         proxy_store_access user:rw group:rw all:rw;
      }
          error_page  500 502 503 504 /50x.html;
          location = /50x.html {
            root  html;
          }
        }
      }
      
      [root@cairui conf]# curl -I http://120.25.255.87/1.jpg
      HTTP/1.1 200 OK
      Server: nginx/1.13.9
      Date: Mon, 05 Mar 2018 04:08:41 GMT
      Content-Type: image/jpeg
      Content-Length: 48561
      Last-Modified: Wed, 29 Nov 2017 08:16:39 GMT
      Connection: keep-alive
      ETag: "5a1e6ce7-bdb1"
      Expires: Mon, 12 Mar 2018 04:08:41 GMT
      Cache-Control: max-age=604800
      Accept-Ranges: bytes

      2、Nginx壓縮模塊(gzip)

      Nginx服務(wù)優(yōu)化配置的示例分析

      配置壓縮模塊

      [root@localhost vhost]# vi www.vhosts
      server {
      listen 8001;
      server_name 192.168.1.3;
      location / {
      root /web/www;
      index index.html index.htm;
      access_log /application/nginx/log/access_www.log commonlog;
      }
      location ~ .*\.(gif|jpg|jpge|png|bmp|swf)$
      {
      expires 3560d;
      root /web/www;
      }
      location ~ .*\.(js|css)?$
      {
      expires 30d;
      root /web/www;
      }
      gzip on; #開啟壓縮功能
      gzip_min_length 1k; #設(shè)置允許壓縮頁面的最小字節(jié)數(shù)
      gzip_buffers 4 16k;
      gzip_http_version 1.0;
      gzip_comp_level 2;
      gzip_types text/plain application/x-javascript text/css application/xml;
      gzip_vary on;
      }

      檢查語法、重啟服務(wù)

      [root@localhost vhost]# /application/nginx/sbin/nginx -t
      nginx: the configuration file /application/nginx-1.10.1/conf/nginx.conf syntax is ok
      nginx: configuration file /application/nginx-1.10.1/conf/nginx.conf test is successful
      [root@localhost vhost]# /application/nginx/sbin/nginx -s reload
      [root@localhost vhost]# cd /web/www/
      [root@localhost www]# ll
      total 12
      -rw-r--r--. 1 root root 20 Sep 26 07:00 index.html
      -rw-r--r--. 1 root root 5798 Sep 19 06:46 MySQL.jpg
      [root@localhost www]# rz
      rz waiting to receive.
      Starting zmodem transfer. Press Ctrl+C to cancel.
      Transferring 1.js...
      100% 42 KB 42 KB/s 00:00:01 0 Errors
      ?[root@localhost www]# ll
      total 56
      -rw-r--r--. 1 root root 43978 Sep 27 05:06 1.js
      -rw-r--r--. 1 root root 20 Sep 26 07:00 index.html
      -rw-r--r--. 1 root root 5798 Sep 19 06:46 mysql.jpg
      客戶端訪問 http://192.168.1.3:8001/1.js
      [root@localhost www]# curl -I http://192.168.1.3:8001/1.js
      HTTP/1.1 200 OK
      Server: nginx/1.10.1
      Date: Tue, 27 Sep 2016 04:44:08 GMT
      Content-Type: application/javascript
      Content-Length: 43978
      Last-Modified: Tue, 27 Sep 2016 02:06:23 GMT
      Connection: keep-alive
      ETag: "57e9d41f-abca"
      Expires: Thu, 27 Oct 2016 04:44:08 GMT
      Cache-Control: max-age=2592000
      Accept-Ranges: bytes

      感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“Nginx服務(wù)優(yōu)化配置的示例分析”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!


      文章名稱:Nginx服務(wù)優(yōu)化配置的示例分析
      網(wǎng)站路徑:http://www.ef60e0e.cn/article/gseced.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        开化县| 无锡市| 西充县| 沙坪坝区| 玉山县| 陵川县| 太和县| 大丰市| 会东县| 合山市| 焦作市| 息烽县| 南皮县| 石景山区| 太湖县| 名山县| 东阿县| 齐河县| 桐柏县| 彩票| 麻江县| 雅江县| 尼勒克县| 集安市| 漳州市| 桐梓县| 荣成市| 栾川县| 奈曼旗| 泸定县| 竹山县| 古田县| 正蓝旗| 青龙| 涿州市| 湛江市| 秀山| 高唐县| 锦州市| 永仁县| 黔东|