1
huihuimoe 2018-02-28 01:30:51 +08:00 via Android
|
2
xiaopc 2018-02-28 06:41:53 +08:00 via Android
|
3
galvinwang007 2018-02-28 11:11:53 +08:00
可以参考这个插件的实现
https://wordpress.org/plugins/wpjam-qiniu/ |
4
happylty OP |
5
xiaopc 2018-02-28 15:20:16 +08:00 via Android
@happylty 他那个 conf 是能 301 跳转的,他说没解决是 HTML 里的图片地址直接换成 CDN 的地址,那个要用 sub_filter
话说 WP 纯静态干嘛,不是生成 cache 就行了吗 |
8
happylty OP @xiaopc #真静态 BEGIN Super Static Cache
location / { #ngx_http_gzip_static_module and ngx_http_gunzip_module Must Be Added To Nginx gzip_static always; gunzip on; if (-f $request_filename) { break; } if ($uri ~ /(.*)$){ set $wpuri $1; set $sscfile $document_root/super-static-cache/$1; } set $ssc Y; if ($query_string !~ .*=.*){ set $ssc "${ssc}Y"; } if ($request_method != "POST"){ set $ssc "${ssc}Y"; } if (-f $sscfile.gz){ set $ssc "${ssc}F"; } if (-f $sscfile/index.html.gz){ set $ssc "${ssc}I"; } if ($ssc = YYYF){ rewrite . /super-static-cache/$wpuri break; } if ($ssc = YYYI){ rewrite . /super-static-cache/$wpuri/index.html break; } if (!-e $request_filename){ rewrite . /index.php last; } } #End Super Static Cache |