Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
「/」がウザい / Take measures on the trailing slash i...
Search
Jun Kudo
September 25, 2021
Technology
0
370
「/」がウザい / Take measures on the trailing slash in WebApps
Japan Azure User Group 11周年イベント LT資料
WebAppsの「/」について解説とリダイレクトの対策
Jun Kudo
September 25, 2021
Tweet
Share
More Decks by Jun Kudo
See All by Jun Kudo
Azure AI Service を支えるAI Platform とはなんけ?
jkudo
0
20
Azure OpenAIのコンテンツフィルターを学ぶ
jkudo
0
1.9k
Azure Policyから始めるガバナンス
jkudo
0
760
5分で解るかもしれないMicrosoft Ignite 2023でのServerless関連アップデート
jkudo
0
570
第42回 Tokyo Jazug Night - ネットワークを伸ばせどこまでも
jkudo
0
620
Dynatrace デモ (Azure)
jkudo
0
660
Other Decks in Technology
See All in Technology
Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて
watahani
0
390
2025年 山梨の技術コミュニティを振り返る
yuukis
0
150
国井さんにPurview の話を聞く会
sophiakunii
1
300
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
2
670
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
5
1.5k
わが10年の叡智をぶつけたカオスなクラウドインフラが、なくなるということ。
sogaoh
PRO
1
190
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
130
ソフトウェアエンジニアとAIエンジニアの役割分担についてのある事例
kworkdev
PRO
1
360
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
4
21k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
59k
Eight Engineering Unit 紹介資料
sansan33
PRO
0
6.1k
善意の活動は、なぜ続かなくなるのか ーふりかえりが"構造を変える判断"になった半年間ー
matsukurou
0
220
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
62
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Exploring anti-patterns in Rails
aemeredith
2
220
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
A Tale of Four Properties
chriscoyier
162
23k
Unsuck your backbone
ammeep
671
58k
Practical Orchestrator
shlominoach
190
11k
Technical Leadership for Architectural Decision Making
baasie
0
200
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
130
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
110
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
The Curse of the Amulet
leimatthew05
0
6.7k
Transcript
「/」がウザい Jun Kudo
https://slash1.azurewebsites.net/folder/ と https://slash1.azurewebsites.net/folder は違う Web Apps
# curl -I https://slash1.azurewebsites.net/folder HTTP/1.1 301 Moved Permanently Content-Length: 163
Content-Type: text/html; charset=UTF-8 Location: https://slash1.azurewebsites.net/folder/ Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET # curl -I https://slash1.azurewebsites.net/folder/ HTTP/1.1 200 OK Content-Length: 0 Content-Type: text/html Accept-Ranges: bytes ETag: W/"8c40f6f16ab0d71:0" Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET 一部省略 一部省略
https://slash1.azurewebsites.net/folder/ (Trailing Slash) Web Apps はURL末の「/」がないとリダイレクトされる (Windowsのみ)
まぁ Web Apps を単体で 利用する場合には特に問題ない気がする
「何も表示されません!?」
バックエンドプール slash1.azurewebsites.net ドメイン www.server01.pw Application Gateway
②バックエンドプール https://slash1.azurewebsites.net/folder ③応答ヘッダー:Location https://slash1.azurewebsites.net/folder/ ①アクセス https://www.server01.pw/folder ④アクセス https://slash1.azurewebsites.net/folder/ アクセス制限 (AppGWのみ許可)
① ② ③ ④
# curl -I https://www.server01.pw/folder HTTP/1.1 301 Moved Permanently Content-Type: text/html;
charset=UTF-8 Content-Length: 167 Connection: keep-alive Location: https://slash1.azurewebsites.net:443/folder/ Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET 一部省略
対策例 リダイレクト URL を変更する (Locationヘッダーの書き換え) https://docs.microsoft.com/ja-jp/azure/application-gateway/rewrite-http-headers-url#modify-a-redirection-url
②バックエンドプール https://slash1.azurewebsites.net/folder ③応答ヘッダー:Location https://slash1.azurewebsites.net/folder/ ①アクセス https://www.server01.pw/folder ⑤アクセス https://www.server01.pw/folder/ ⑥バックエンドプール https://slash1.azurewebsites.net/folder/
④応答ヘッダー:Locationを書き換え https://www.server01.pw/folder/ ④ ③ ① ② ⑤ ⑥
# curl -I https://www.server01.pw/folder HTTP/1.1 301 Moved Permanently Content-Type: text/html;
charset=UTF-8 Content-Length: 167 Connection: keep-alive Location: https://www.server01.pw:443/folder/ Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET 一部省略
Application Gatewayの書き換えセットの作成 ヘッダー値: {http_resp_Location_1}://www.server01.pw{http_resp_Location_2} ④応答ヘッダー:Locationを書き換え https://www.server01.pw/folder/ ③応答ヘッダー:Location https://slash1.azurewebsites.net/folder/
「/」と仲良くしよう
私は、 工藤淳 Microsoft MVP for Azure Iret, inc. / cloudpack
@jkudo です。