无法连接到 localhost:6379 上的 Redis (Errno::EADDRNOTAVAIL)

所以,如果你移除反向代理后它就能工作了?那么问题就出在反向代理的配置上:wink:

是的!

@Falco 我终于找到解决方案了!之前尝试通过 HAPROXY、NGINX 和 APACHE 进行 HTTP 反向代理,虽然网站能访问,但删除问题始终存在。

昨晚我做了最后一次尝试,因为我真的很想用 Discourse,于是心想:再试一次 HTTPS 吧,虽然可能没区别,但在放弃前为什么不试试呢?

结果,使用 HTTPS 后一切完美运行。对我来说这样最好,我就把 HTTP 扔进垃圾桶吧 :joy:

以下是 Apache 配置的相关部分:

\u003e \u003cVirtualHost *:443\u003e
\u003e ServerName discourse.apicolturaitalianafb.it
\u003e \tSSLEngine on
\u003e \tSSLCertificateFile "/usr/local/ssl/crt/certificate.crt"
\u003e \tSSLCertificateKeyFile "/usr/local/ssl/crt/private.key"
\u003e \tSSLCertificateChainFile "/usr/local/ssl/crt/ca_bundle.crt"
\u003e \u003cLocation /\u003e
\u003e ProxyPreserveHost On
\u003e RequestHeader set Host "discourse.apicolturaitalianafb.it:8443"
\u003e ProxyPass http://discourse.apicolturaitalianafb.it:8880/
\u003e \u003c/Location\u003e
\u003e \u003c/VirtualHost\u003e

以及 Discourse 的 app.yml 配置:

\u003e templates:
\u003e - "templates/postgres.template.yml"
\u003e - "templates/redis.template.yml"
\u003e - "templates/web.template.yml"
\u003e - "templates/web.ratelimited.template.yml"
\u003e # - "templates/web.socketed.template.yml"
\u003e ## 如果希望添加 Lets Encrypt (https),请取消下面这两行的注释
\u003e #- "templates/web.ssl.template.yml"
\u003e #- "templates/web.letsencrypt.ssl.template.yml"
\u003e
\u003e ## 此容器应暴露哪些 TCP/IP 端口?
\u003e ## 如果您希望 Discourse 与 Apache 或 nginx 等其他 Web 服务器共享端口,
\u003e ## 请参阅 Run other websites on the same machine as Discourse 了解详情
\u003e expose:
\u003e - "8880:80" # http
\u003e # - "8443:443" # https

早就该这样了!:wink:

很高兴你解决了这个问题。