惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
C
Check Point Blog
宝玉的分享
宝玉的分享
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - Franky
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
罗磊的独立博客
S
SegmentFault 最新的问题
S
Secure Thoughts
T
Troy Hunt's Blog
J
Java Code Geeks
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
W
WeLiveSecurity
Help Net Security
Help Net Security
S
Security @ Cisco Blogs
T
Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V2EX - 技术
V2EX - 技术
T
Tor Project blog
S
Security Affairs
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
腾讯CDC
博客园 - 司徒正美
The Last Watchdog
The Last Watchdog
N
News | PayPal Newsroom
博客园 - 聂微东
小众软件
小众软件
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
C
CERT Recently Published Vulnerability Notes
AI
AI
N
News and Events Feed by Topic
C
Cybersecurity and Infrastructure Security Agency CISA
O
OpenAI News
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 最新话题
T
Threat Research - Cisco Blogs
雷峰网
雷峰网
NISL@THU
NISL@THU
V
Visual Studio Blog

czp's blog

Ubuntu 下使用 zsh · HonKit 使用 VNC 来远程管理服务器 · HonKit Linux 下无限试用 JetBrains · HonKit 使用 KMS 激活 Windows · HonKit 为 KVM 中的 Windows 虚拟机启用 VirtIO · HonKit 在 Spring Boot 中处理 MissingKotlinParameterException · HonKit 用 Spring Native 拯救微服务 · HonKit 正确调试 PHP · HonKit Ubuntu 增加最大文件打开数量限制 · HonKit 将 Minecraft 服务端编译到 native · HonKit 用凝聚力购买 P 社游戏 DLC · HonKit 模拟超星网课 Android 客户端 · HonKit 模拟 Bilibili Android 客户端 · HonKit 模拟哔咔 Android 客户端 · HonKit 异步是什么 · HonKit GCP Pub/Sub push 至 IAP 保护的 Endpoint · HonKit 部署 Spring Native 到 GCP App Engine · HonKit 多个 Gradle SubProject 同时编译导致 CI/CD 内存耗尽 · HonKit Google Cloud Build 运行 DIND · HonKit Terraform 不自动更新 CloudRun service · HonKit Telegram Bot 收不到普通群聊消息的问题 · HonKit 加密货币交易 · HonKit 挖掘以太坊 · HonKit 挖掘门罗币 · HonKit 小明学英语 · HonKit 卖程序的小女孩 · HonKit 一个测试工程师走进一家酒吧 · HonKit 我给你们讲个 TCP 笑话吧! · HonKit 我给你们讲个 UDP 笑话吧! · HonKit 格局打开 · HonKit c 语言常见未定义行为 · HonKit 在 Kotlin 使用 SpaceEngineers Remote API · HonKit Kotlin 协程 · HonKit 在 Spring Boot 中正确注册 Jackson Module · HonKit Spring Boot Jpa 使用 Google Cloud SQL · HonKit Spring Boot 中配置单页应用 · HonKit Spring Boot 无法加载 ClasspathResource 问题 · HonKit 正确打包 Spring Boot 到 war · HonKit czp's blog · HonKit 鸣谢列表 · HonKit 友链 · HonKit
在 Google Storage 中部署 SPA · HonKit
2026-04-11 · via czp's blog

本文撰写时的年份: 2023

谢天谢地, 你们谷歌终于在去年底搞出了 Storage 的 404 页面配置.

https://cloud.google.com/storage/docs/hosting-static-website#specialty-pages

单页应用的最大问题是, 虽然全都是静态页面, 但是浏览器刷新时, 实际访问的 path 不对应服务器上的任何文件. 因此若是通常用 Nginx 或者别的 web server 部署 SPA 时都要额外加一条规则, 让 web server 将所有 404 的请求分配到首页(index.html)去.

而谷歌 Storage 现在才支持这种功能:

gcloud storage buckets update gs://my-static-assets --web-main-page-suffix=index.html --web-error-page=index.html

把首页和 404 页面都配置到 index.html. 这下终于 SPA 了起来.

但是事情仍未结束, 你们谷歌 Storage 自定义域名不支持 SSL, 还必须再套一层负载均衡, 妥妥的骗钱: https://cloud.google.com/storage/docs/hosting-static-website#lb-ssl

本来以 Storage 低廉的价格终于可以很便宜的部署一个 SPA 网站, 结果算上负载均衡, 又不便宜了 XD