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
16
Azure OpenAIのコンテンツフィルターを学ぶ
jkudo
0
1.7k
Azure Policyから始めるガバナンス
jkudo
0
750
5分で解るかもしれないMicrosoft Ignite 2023でのServerless関連アップデート
jkudo
0
550
第42回 Tokyo Jazug Night - ネットワークを伸ばせどこまでも
jkudo
0
610
Dynatrace デモ (Azure)
jkudo
0
640
Other Decks in Technology
See All in Technology
DMMの検索システムをSolrからElasticCloudに移行した話
hmaa_ryo
0
370
Kotlinで型安全にバイテンポラルデータを扱いたい! ReladomoラッパーをAIと実装してみた話
itohiro73
3
280
Amazon Q Developer CLIをClaude Codeから使うためのベストプラクティスを考えてみた
dar_kuma_san
0
350
Raycast AI APIを使ってちょっと便利なAI拡張機能を作ってみた
kawamataryo
1
250
今から間に合う re:Invent 準備グッズと現地の地図、その他ラスベガスを周る際の Tips/reinvent-preparation-guide
emiki
1
300
GPUをつかってベクトル検索を扱う手法のお話し~NVIDIA cuVSとCAGRA~
fshuhe
0
390
Oracle Cloud Infrastructure:2025年10月度サービス・アップデート
oracle4engineer
PRO
0
110
AI時代におけるドメイン駆動設計 入門 / Introduction to Domain-Driven Design in the AI Era
fendo181
0
290
30分でわかる!!『OCI で学ぶクラウドネイティブ実践 X 理論ガイド』
oracle4engineer
PRO
1
120
龍昌餃子で理解するWebサーバーの並行処理モデル - 東葛.dev #9
kozy4324
1
120
短期間でRAGシステムを実現 お客様と歩んだ生成AI内製化への道のり
taka0709
1
190
AWS IAM Identity Centerによる権限設定をグラフ構造で可視化+グラフRAGへの挑戦
ykimi
2
290
Featured
See All Featured
The Invisible Side of Design
smashingmag
302
51k
Large-scale JavaScript Application Architecture
addyosmani
514
110k
Practical Orchestrator
shlominoach
190
11k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Facilitating Awesome Meetings
lara
57
6.6k
GitHub's CSS Performance
jonrohan
1032
470k
Why Our Code Smells
bkeepers
PRO
340
57k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
A designer walks into a library…
pauljervisheath
209
24k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
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 です。