drupal - Chrome 和 Firefox 自动重定向到特定站点上的 https

标签 drupal nginx haproxy php

我有一个在 nginx 和 php-fpm 上运行的 drupal 站点,在多个服务器之间使用 haproxy 进行平衡。

我为 haproxy 设置了两个服务:http 和 https。

如果我去http://subdomain.domain.com , 它工作正常。
如果我去 https://subdomain.domain.com ,它也可以正常工作。 如果我然后返回到 http,它现在将重定向到 https。这种情况发生在 firefox 和 chrome 中,但不会发生在 IE 中。

是否有一些设置在知道它存在的情况下自动重定向到 https?也许如果设置了安全 header ?

我尝试查看 LiveHTTPHeaders,但此时它只显示 https 部分。
我试着查看 Chrome,它是这样说的:

t=1312233405229 [st=  0] +REQUEST_ALIVE                             [dt=192]
t=1312233405229 [st=  0]     URL_REQUEST_START_JOB                  [dt=  0]
                             --> load_flags = 1114241 (ENABLE_LOAD_TIMING | MAIN_FRAME | VALIDATE_CACHE | VERIFY_EV_CERT)
                             --> method = "GET"                   
                             --> priority = 0                     
                             --> url = "http://subdomain.domain.com/"   
t=1312233405229 [st=  0]    +URL_REQUEST_START_JOB                  [dt=  0]
                             --> load_flags = 1114241 (ENABLE_LOAD_TIMING | MAIN_FRAME | VALIDATE_CACHE | VERIFY_EV_CERT)
                             --> method = "GET"                   
                             --> priority = 0                     
                             --> url = "http://subdomain.domain.com/"   
t=1312233405229 [st=  0]        URL_REQUEST_REDIRECTED              
                                --> location = "https://subdomain.domain.com/"

它似乎在进行重定向,但没有说明原因。

我尝试使用 Wireshark 进行嗅探,但无法理解它,因为我无法使用 SSL 解密(我有 key )。

最佳答案

我想通了。我在 nginx 中有一个设置:add_header Strict-Transport-Security "max-age=7200";这是 chrome 和 firefox 4 支持的新功能:chromium.org/sts

关于drupal - Chrome 和 Firefox 自动重定向到特定站点上的 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6905389/

相关文章:

php - 如何根据特定字段的值更改行的颜色?

Oracle PDO OCI 字符集失败

SSL over HAProxy 问题

ubuntu - 我们应该登录到 haproxy.log 什么?

email - Drupal 获取站点范围的电子邮件地址?

drupal 6 cck字段: is there a easy way to duplicate cck field?

php - 当我使用 php setrawcookie 函数时出现服务器错误

node.js - Openshift Layer4 连接,应用程序无法启动

php - 如何通过mysql手动重置drupal 7中的权限?

nginx - 如何在lua或nginx中获取查询参数?