【问题标题】:Chrome throws ERR_CONNECTION_REFUSED when Apache redirects HttpS request to http当 Apache 将 HttpS 请求重定向到 http 时,Chrome 会抛出 ERR_CONNECTION_REFUSED
【发布时间】:2015-09-10 10:09:56
【问题描述】:

如何允许将 https 请求重定向到 apache 网络服务器到 http url 而浏览器不会抛出以下异常

ERR_CONNECTION_REFUSED

我在 httpd.conf 中尝试了以下配置

Options +FollowSymLinks 
SSLOptions +StdEnvVars
SSLVerifyClient optional
SSLVerifyDepth 3

RewriteEngine On

RewriteCond %{SSL:SSL_CLIENT_VERIFY} !^SUCCESS$
RewriteRule ^.*\.js$ /newRedirectedForJS.php [L]    

RewriteCond %{HTTPS} !=off
RewriteRule ^.*\.js$ /newRedirectedForJS.php [L]

编辑:1

例如

从 anothersite.com 到 mysite 的链接是“https://myserver.com/req.php”,但我想在我的 apache 网络服务器中将该请求重定向到“http://myserver.com.redirect.php”

【问题讨论】:

  • 80 端口上是否有任何 http 服务器在运行?可能只启用了 https。
  • 是的,httpd 正在端口 80 上运行。从另一个站点,到达我服务器的链接是“https://myserver.com/request.php”,但我需要使用“重定向” http://myserver.com/newRedirect.php"

标签: apache google-chrome mod-rewrite ssl https


【解决方案1】:

实际上,您需要重定向,而不仅仅是重写,因为您正在更改端口(如果您想保留原始 https URL,则需要代理请求,但我什至不确定它是否会起作用)。

为了实现这一点,请确保将 [L] 更改为 [L,R]。 您可能希望将其指定为永久重定向,除非您打算稍后切换回 https。

所以最后如果看起来像[L,R=301]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    • 2019-11-08
    • 1970-01-01
    • 2015-02-02
    相关资源
    最近更新 更多