正所謂愛之深責之切,這個功能已經提了三年多,GCP專隊還沒開發出來,逼不得已先讓大家知道,以免大家對GCP期待太高。
https://issuetracker.google.com/issues/35904733
只能用自架的Web Server來解決
1. Nginx的設定方勻
https://serverfault.com/questions/862725/how-can-you-redirect-http-to-https-gcp-load-balancing
2.Apache的設定檔
# allow for healthcheck to occur
RewriteCond %{REQUEST_URI} !^/healthcheck.html
# redirect http to https
RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
# redirect www to non www (if you want)
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
無論如何,GCP還是有很多優點,各家公有雲有各自擅長的地方,各位可以擷長補短。
留言
張貼留言