反向代理和 HTTPS 背后的讨论

我迁移了我们的 discourse 到新的设置,现在在登录时遇到 http 403 POST session 问题。我猜测是 CSRF 问题,但目前我不知道从哪里开始调试,而且 /var/log/discourse-var-log/production.log 和 production_error.log 文件大小都是 0 字节……

有什么办法可以正确调试这个问题吗?

当前设置:
1. haproxy 作为中心 https 负载均衡器/加速器(用于 discourse 和其他服务)

forum >> develd apache rev. proxy p.82
backend forum-backend
   mode http
   server forum.netzwissen.de 10.10.10.14:83 cookie A check
   http-request set-header X-Forwarded-Port %[dst_port]
   http-request add-header X-Forwarded-Proto https if { ssl_fc }
   # HSTS header, 16000000 秒:略多于 6 个月
   http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"

2. 本地 apache 作为反向代理

   <IfModule proxy_module>
    ## <https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247>
    ProxyPreserveHost On
    # ProxyRequests Off     
    RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
    RequestHeader set X-Real-IP expr=%{REMOTE_ADDR}
    ProxyPass /  unix:/var/discourse/shared/web-only/apache.http.sock|http://localhost/
    ProxyPassReverse  / unix:/var/discourse/shared/web-only/apache.http.sock|http://localhost/
    </IfModule>

3) Discourse 使用独立的 web_only 和 data 容器运行,web_only 使用 - “templates/web.socketed.template.yml” 部署