nginx下wordpress 固定链接问题

情况是这样的,

我的wordpress并不是放在网站的根目录的,而是放在/blog目录下的,然后在wordpress中设置固定链接的时候,每次都出错,用了网上几个方法都不行,后来在http://codex.wordpress.org/Nginx 找到一个解决办法。

我正好安装了wp super cache的插件,那么在nginx.conf中添加如下:

image

代码如下:

set $cache_uri $request_uri;
        location /blog {
            try_files /blog/wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /blog/index.php?$args ;
        }

原文地址:https://www.cnblogs.com/huangjacky/p/3886704.html