【问题标题】:Google compute engine, How to send 301 to redirect to https谷歌计算引擎,如何发送 301 重定向到 https
【发布时间】:2015-05-04 12:59:38
【问题描述】:

我希望能够始终在 https 中提供网站服务。我不是 apache 专家,但人们就是这样做的:

RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]

代码来自: https://serverfault.com/questions/570288/is-it-bad-to-redirect-http-to-https

有没有办法用 GCE 做到这一点?我只能在文档转发规则中看到,但对重定向一无所知。

谢谢

狮子座

【问题讨论】:

  • 这些设置在负载均衡器后面的 Apache 服务器上不起作用。有没有办法从负载均衡器本身做到这一点?

标签: google-cloud-storage google-compute-engine


【解决方案1】:

Google Compute Engine 允许您在 Google 的硬件上运行 Linux 和 Apache 等软件,方法是使用虚拟化让您看起来拥有自己的专用机器。

如果您将其安装在 GCE 实例上的 Apache 配置中,上述 apache 配置的 sn-p 应该可以工作。

【讨论】:

  • 感谢您的建议。我认为应该有办法在负载平衡之前或在转发规则中做。在打虚拟机之前的某个地方
猜你喜欢
  • 2013-01-19
  • 2018-07-14
  • 2014-04-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-05
  • 1970-01-01
  • 2011-04-07
相关资源
最近更新 更多