大网数据广告活动
服务器运维问答

How can I enable HSTS on the default Google Load Balancer coming with Google Container Engine?

· 52CE 我爱测

I'd love to set up HSTS with my GKE cluster, as right now HTTP requests return a Google broken robot 404 page after setting this up in ingress.yml annotations : kubernetes.io/ingress.allow-http: "false" Apparently there are optio…

问题原文

原帖链接 · dain · CC BY-SA 3.0

I'd love to set up HSTS with my GKE cluster, as right now HTTP requests return a Google broken robot 404 page after setting this up in ingress.yml annotations: kubernetes.io/ingress.allow-http: "false"

Apparently there are options for this in ingress.yml (namely hsts-max-age and hsts-include-subdomains), but as far as I understand it's not supported by GKE: https://github.com/kubernetes/ingress/blob/7c749ede0a2d88f289279d61d04005e22f002104/docs/annotations.md#tls-related

I'd really like to avoid using and maintaining a custom Nginx load balancer and losing Google's scaling, sticking to the default one would be a strong requirement. I'd also like to avoid letting HTTP requests pass through and handling redirects and the HSTS header in my app.

If HSTS isn't possible, I could live with a good redirection setup.

Thanks a lot!

已采纳解答

原帖链接 · philsch · CC BY-SA 4.0

Google Cloud seems to support now custom request and response headers for HTTP(S) Load Balancers. I've added a custom Strict-Transport-Security response header for our backend and it works as expected.

In the given example we use a backend bucket, however the custom header option is available for other backend types too.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-07-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。