Nginx 透過Proxy_pass php 安裝 WordPress 會遇到的SSL 及 固定網址permalink 問題

1.Nginx 安裝Wordpress 會先遇到無窮迴圈問題(too many redirects)
在你的佈景主題中的function.php最下方加入
remove_filter('template_redirect', 'redirect_canonical');

2.遇到SSL進不去的話,wp-config.php最上方(The Top)加入
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
$_SERVER['HTTPS'] = 'on';

3.固定網址失效(Permalink Don’t work):
修改你的nginx conf,如下
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}

同時安裝這個外掛 Permalink Fix & Disable Canonical Redirects Pack

Enjoy!

yan

Share
Published by
yan