iT邦幫忙

2023 iThome 鐵人賽

DAY 11
0
SideProject30

Hugo your Blog and Host your Podcast. 系列 第 11

Domain HTTPS / We're not in Kansas anymore.

  • 分享至 

  • xImage
  •  

There is no place like home, your domain is your home.

  • 補充沒人想知道的標題出處:The Wizard of Oz 意指來到不熟悉、不再安全的地方。
  • 既然地球這麼不安全,就把剛拿到手的安全憑證用起來吧!

該怎麼做

  • 來到 Cloudfront 選定之前建立起來作為 S3 Static website CDN 的 Distribution
  • 在 General/ Settings,點擊 Edit
  • Alternate Domain Names (CNAMEs) 輸入你的 Domain name,忘記的可以去 Route 53/ Registered domains 查詢
  • 不該忘記自己的 Domain 啊!
  • 下方 Custom SSL Certificate 選擇你在 ACM 為你的 Domain 所申請到的 SSL 憑證,再 Save changes
    https://ithelp.ithome.com.tw/upload/images/20230926/20152944P7mOWO6DNP.png
  • 來到 Route53 選擇 create record
  • Record type 為 A 並選擇打開 Alias, Alias to CloudFront distribution,下拉出剛才編輯的 Distribution,再 Save
    https://ithelp.ithome.com.tw/upload/images/20230926/20152944ifuKlAQvb4.png
  • 好了,現在你的 Domain 就可以使用 HTTPS 來存取 Hugo 網站囉!

其他延伸

  • 作者的朋友說,沒事不要編輯 Registerd Domains 的 Name Server,這樣可能導致你的 Domain 無法使用
  • 從 Domain -> Cloudfront -> S3 這樣一條路已經串接起來,對於靜態網站之後的部屬,只要將修改的 Hugo 重新上傳到 S3,等待 CDN 過期後就可以看到更新的網站囉!
  • 這是一份阿姆斯特丹市立美術館面向參訪者提供的 QR code 內容 館場介紹圖,可以發現此資源是直接使用 S3 存取而沒有掛載 CDN,我們有掛我們很棒,他們有錢他們任性。

外出取材

  • 逛完博物館區,可吃附近的 The Pantry,搭配啤酒 Feeling Dutch Tripel,晚上就會睡不著,清醒著寫鐵人賽。
    https://ithelp.ithome.com.tw/upload/images/20230926/201529441FMFw9s9nq.jpg

上一篇
AWS ACM / Make security a priority.
下一篇
Git init / Push "public" to "private" hub.
系列文
Hugo your Blog and Host your Podcast. 30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言