wordpress - Pound SSL Wrapper Wordpress 登录问题

标签 wordpress ssl nginx session-cookies pound

我的设置是这样的

访问者 -> Pound -> Varnish -> nginx

我的 Wordpress 网站从前端(使用 https)看起来很好,但是当我尝试登录到后端时,就会出现此错误“您没有足够的权限访问此页面。”

当我将 Pound 从链中取出时,它工作正常(仅使用 http 清漆)但 nginx 直接没有清漆也使用 SSL。

这是我的英镑配置

User            "www-data"
Group           "www-data"
LogLevel        1
Alive           30
Control "/var/run/pound/poundctl.socket"

ListenHTTP
    Address  0.0.0.0
    Port     80
    Service
        BackEnd
            Address 127.0.0.1
            Port    6081
        End
    End
End

ListenHTTPS
    HeadRemove "X-Forwarded-Proto"
    AddHeader  "X-Forwarded-Proto: https"
    Address    0.0.0.0
    Port       443
    Cert       "/etc/ssl/domain.com/mycert.pem"

    Service
        BackEnd
            Address 127.0.0.1
            Port    6081
        End
    End
End

服务器是 Ubuntu 14.04

谢谢

最佳答案

您必须在 wordpress 的 wp-config.php 文件中添加以下给定的命令


    if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
       $_SERVER['HTTPS']='on';

并确保将其粘贴到 wp-config.php 文件中下面代码行的上方:)


    require_once(ABSPATH . 'wp-settings.php');

关于wordpress - Pound SSL Wrapper Wordpress 登录问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30305510/

相关文章:

MySQL:根据多行数据合并多个相关表

wordpress - 查找和删除数据库中未使用的表 (WordPress)

php - 获取所选字段中可用的 WooCommerce 优惠券的列表

wordpress - 在注册时强制使用 SSL 但在非注册页面上删除 SSL

java - 使用 SSL 发送电子邮件在我的 Java 应用程序中不起作用,TLS 起作用

ssl - Wget TLS SNI 支持设置服务器名称

apache - 是什么可以阻止我用apache激活http2?

django - 无法使 nginx 内部重定向工作

http - 使用 nginx 重定向所有不是来 self 的 IP 的请求

shell - 从 bash 脚本文件运行 docker-compose