nginx下wp-super的rewrite规则

location / {
# if the requested file exists, return it immediately
               if (-f $request_filename) {
                       break;
               }
               set $supercache_file ”;
               set $supercache_uri $request_uri;
               if ($request_method = POST) {
                       set $supercache_uri ”;
               }
# Using pretty permalinks, so bypass the cache for any query string
               if ($query_string) {
                       set $supercache_uri ”;
               }
               if ($http_cookie ~* “comment_author_|wordpress|wp-postpass_” ) {
                       set $supercache_uri ”;
               }
# if we haven’t bypassed the cache, specify our supercache file
               if ($supercache_uri ~ ^(.+)$) {
                       set $supercache_file /wp-content/cache/supercache/$http_host/

$1index.html;
               }
# only rewrite to the supercache file if it actually exists
               if (-f $document_root$supercache_file) {
                       rewrite ^(.*)$ $supercache_file break;
               }
# all other requests go to WordPress
               if (!-e $request_filename) {
                       rewrite . /index.php last;
               }

0 0 投票数
文章评分
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x