欧美一区2区三区4区公司二百,国产精品婷婷午夜在线观看,自拍偷拍亚洲精品,国产美女诱惑一区二区

歡迎來到云服務(wù)器

服務(wù)器租用

WP Super Cache在Nginx下安裝要領(lǐng)和URL重寫(偽靜態(tài))法則配置

WP Super Cache是今朝緩存插件利用的最多的一個,在我的WordPress緩存優(yōu)化中并未提起,但并不代表WP Super Cache欠好。出格是nginx下面,其實是由于WP Super Cache在nginx安裝利用,和URL重寫即偽靜態(tài)法則相對在apache下面更難配置。

安裝與配置WP Super Cache

在WordPress儀表盤插件欄搜索WP Super Cche,,安裝即可。

WP Super Cache在Nginx下安裝要領(lǐng)和URL重寫(偽靜態(tài))法則配置

安裝WP Super CacheWP Super Cache在Nginx下安裝要領(lǐng)和URL重寫(偽靜態(tài))法則配置

啟用緩存成果 (推薦)

啟用后,會呈現(xiàn)提示:

Mod rewrite 模塊大概未安裝!

貌似 mod_rewrite 模塊尚未安裝。也許環(huán)境并不是這樣,尤其是當(dāng)您不利用 Apache 作為處事器措施的時候。請查抄
mod_rewrite 模塊是否被加載。這對付 Super Cache 的靜態(tài)文件的挪用是必須的。不外您可以利用 PHP
緩存模式可能傳統(tǒng)模式運行本插件。

不消管這個提示,這是針對apache處事器的提示,nginx下面不消管它。

WP Super Cache在Nginx下安裝要領(lǐng)和URL重寫(偽靜態(tài))法則配置

高級配置勾選項 WP Super Cache的nginx url重寫法則

將本來的nginx重寫法則

try_files $uri $uri/ /index.php?$args;

修改為

try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args ;

server {
    ....
}

中間插入

        # WP Super Cache rules.
        # Designed to be included from a 'wordpress-ms-...' configuration file.
        set $cache_uri $request_uri;
        # POST requests and urls with a query string should always go to PHP
        if ($request_method = POST) {
                set $cache_uri 'null cache';
        }
        if ($query_string != "") {
                set $cache_uri 'null cache';
        }
        # Don't cache uris containing the following segments
        if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
                set $cache_uri 'null cache';
        }
        # Don't use the cache for logged in users or recent commenters
        if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
                set $cache_uri 'null cache';
        }
        # START MOBILE
        # Mobile browsers section to server them non-cached version. COMMENTED by default as most modern wordpress themes including twenty-eleven are responsive. Uncomment config lines in this section if you want to use a plugin like WP-Touch
        # if ($http_x_wap_profile) {
        #        set $cache_uri 'null cache';
        #}
        #if ($http_profile) {
        #        set $cache_uri 'null cache';
        #}
        #if ($http_user_agent ~* (2.0 MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo Wii|Nitro|Nokia|Opera Mini|Palm|PlayStation Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915 Obigo|LGE VX|webOS|Nokia5800)) {
         #       set $cache_uri 'null cache';
        #}
        #if ($http_user_agent ~* (w3c |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda |xda-)) {
          #      set $cache_uri 'null cache';
        #}
        #END MOBILE

千萬不要插在

location / {
    ....
}

中間。

檢討是否生效

重啟nginx,查察網(wǎng)頁源碼,底部是否增加了雷同如下的注釋,假如有即代表樂成。

騰訊云代理

Copyright © 2003-2021 MFISP.COM. 國外vps服務(wù)器租用 夢飛云服務(wù)器租用 版權(quán)所有 ? 粵ICP備11019662號

主站蜘蛛池模板: 固原市| 贵港市| 南涧| 贺州市| 罗城| 内丘县| 瓦房店市| 务川| 钟山县| 南平市| 威宁| 济宁市| 新昌县| 静宁县| 秦皇岛市| 海南省| 遵化市| 永嘉县| 罗定市| 习水县| 梨树县| 松滋市| 灵川县| 遂宁市| 伊宁县| 贞丰县| 西贡区| 麻江县| 兴义市| 广昌县| 阿鲁科尔沁旗| 阿拉善左旗| 会泽县| 得荣县| 宁波市| 东光县| 井研县| 大石桥市| 兰州市| 抚州市| 安塞县|