【问题标题】:Run Mercure on production with Symfony and Apache | HTTPS problem使用 Symfony 和 Apache 在生产环境中运行 Mercure | HTTPS 问题
【发布时间】:2021-07-04 10:30:51
【问题描述】:

我有一个 symfony 应用程序,我正在使用 Mercure。

要运行 Mercure,我使用此命令

SERVER_NAME=:3000 MERCURE_PUBLISHER_JWT_KEY='something' MERCURE_SUBSCRIBER_JWT_KEY='something' CORS_ALLOWED_ORIGINS=https://my-domain.cz ALLOW_ANONYMOUS=1 ./mercure run -config Caddyfile

我已经安装了 Let's encrypt 颁发的 SSL 证书。 我的阿帕奇:

<VirtualHost *:80>
....
ProxyRequests off
<LocationMatch /mercure>
ProxyPass http://localhost:3000
ProxyPassReverse http://localhost:3000

...
RewriteCond %{SERVER_NAME} =my-domain.cz
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

问题。当我尝试订阅某个主题时,会收到此错误

GET https://my-domain.cz:3000/.well-known/mercure?topic=someGoodTopic net::ERR_SSL_PROTOCOL_ERROR

如果我尝试从浏览器获取此 URL,我会遇到同样的问题,但如果我尝试使用 http://,一切都会好起来的,但不幸的是,我无法从我的 https 域请求 http .

(Mixed Content: The page at 'https://my-domain.cz/' was loaded over HTTPS, but requested an insecure EventSource endpoint 'http://my-domain.cz:3000/.well-known/mercure?topic=someGoodTopic'. This request has been blocked; the content must be served over HTTPS.)

如果有人可以帮助我,我会很高兴 =)

【问题讨论】:

    标签: php apache symfony ssl mercure


    【解决方案1】:

    不确定这是否是答案,但您的错误可能与允许匿名连接到 mercure 有关。除此之外它看起来还不错。不久前,我通过 https 设置了 mercure,实际上并没有任何具体的事情需要做。尝试使用 Mercure 设置身份验证,然后告诉我进展如何。

    【讨论】:

      猜你喜欢
      • 2020-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-16
      • 2017-08-13
      • 2018-10-28
      • 2014-11-11
      • 2011-01-26
      相关资源
      最近更新 更多