[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Osaka/Yokohama] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

【Part2】GCPのグローバル外部 HTTP(S) ロードバランサで、URLリダイレクト設定する方法

*らーめん 一嗹 (三宮)

こんにちは!
株式会社ビヨンド大阪オフィスのラーメン王、ヒデです。
今回が9回目の投稿です。

前回は GCP の Google Cloud Load Balancing(GCLB)のグローバル外部 HTTP(S) ロードバランサ(従来型)で、URLリダイレクト設定をする方法ついて書きました!

今回は、前回の続きでGCLBのグローバル外部 HTTP(S) ロードバランサで、URLリダイレクト設定をする方法について書きます。

従来型とは違って少し難しいですが、一緒に頑張っていきましょう。

※ 従来型のURLリダイレクト設定に興味ある方は、ぜひ以下の記事を見てくださいね!

【Part1】GCP のグローバル外部 HTTP(S) ロードバランサ(従来型)で、URLリダイレクト設定する方法

【Part1】GCP のグローバル外部 HTTP(S) ロードバランサ(従来型)で、URLリダイレクト設定する方法

設定手順

*ロードバランサー(LB)は作成している前提で行います。

① ロードバランシング > LB名 > 編集をクリック

② 詳細なホストとパスのルールを選択して【ホストとパスのルールを追加】をクリック

③ 新しいホストとパスのルールでリダイレクト元のドメインを指定する

④ リダイレクト設定をして【更新】をクリック

URLリダイレクト設定公式ドキュメント

defaultService: global/backendServices/バックエンド名
name: matcher1 *好きな名前を指定してください
routeRules:
- urlRedirect:
    stripQuery: true *クエリ削除の有無
    hostRedirect: test2.com *リダイレクト先を指定
  matchRules:
  - prefixMatch: / *リダイレクトされる時のパスを指定
  priority: 0 *0が最優先になります

⑤ 動作確認

*LB の更新が終わってから行ってください。
*リダイレクトされるか確認してください。

 

 

まとめ

いかがでしたでしょうか?

従来型のグローバル HTTP(S) ロードバランサはリダイレクト設定しやすいですが、グローバル HTTP(S) ロードバランサはコード化されているので、ややこしかったと思います。

でも、しっかりロードバランサでリダイレクト設定ができれば、サーバーでリダイレクト設定をせずとも、負荷をかけないでリダイレクトができるのでオススメです。

GCP の LB でリダイレクト設定をする場合は、ぜひ参考にしてみてくださいね!

この記事がお役に立てば【 いいね 】のご協力をお願いいたします!
2
読み込み中...
2 票, 平均: 1.00 / 12
1,698
X facebook はてなブックマーク pocket
[2024.6.30 CentOS support ended] CentOS server migration solution

[2024.6.30 CentOS support ended] CentOS server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Hide@Infrastructure Engineer

It all started with a very interesting interview.
A mid-career employee of the System Solutions Department in Osaka.My
job is to build and operate servers and clouds!
I have the qualifications of LPIC1, AWS SAA, and OCI Architect Associate.

Actually, I love ramen and
have investigated over 100 stores in Osaka (。-∀-) I'm striving to become the Ramen King of Nibi Beyond
!

I'm also on Twitter, so please follow me (´∇`)
Click on the Twitter mark on the right corner! !