【发布时间】:2016-02-24 13:31:11
【问题描述】:
当使用仅 SNI 证书(Let's Encrypt,CloudFlare 免费)时,使用带有 Chrome 或 IE 的 Windows XP 的用户是not able to connect to your site。 XP 上的 Firefox 运行良好。
我想测试用户代理是 XP 上的 Chrome 还是 XP 上的 IE(或 XP 上不是 Firefox 的任何东西),并将它们重定向到一个 HTTP 警告页面,告诉他们在 XP 上使用 Firefox。
在 nginx 下你会怎么做呢?
目前,我正在使用此块将所有 http 链接重定向到 https。
if ($http_cf_visitor ~ '{"scheme":"http"}') {
return 301 https://$server_name$request_uri;
}
如何将上述用户代理检测合并到此块中,以便将非 SNI 用户重定向到仅 HTTP 警告页面?
【问题讨论】:
标签: nginx browser https windows-xp sni