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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
26
Azure OpenAIのコンテンツフィルターを学ぶ
jkudo
0
1.9k
Azure Policyから始めるガバナンス
jkudo
0
780
5分で解るかもしれないMicrosoft Ignite 2023でのServerless関連アップデート
jkudo
0
590
第42回 Tokyo Jazug Night - ネットワークを伸ばせどこまでも
jkudo
0
630
Dynatrace デモ (Azure)
jkudo
0
670
Other Decks in Technology
See All in Technology
SaaSに宿る21g
kanyamaguc
2
180
スケーリングを封じられたEC2を救いたい
senseofunity129
0
110
AI時代のIssue駆動開発のススメ
moongift
PRO
0
280
なぜarray_firstとarray_lastは採用、 array_value_firstとarray_value_lastは 見送りだったか / Why array_value_first and array_value_last was declined, then why array_first and array_last was accpeted?
cocoeyes02
0
200
VSCode中心だった自分がターミナル沼に入門した話
sanogemaru
0
820
SaaSの操作主体は人間からAIへ - 経理AIエージェントが目指す深い自動化
nishihira
0
110
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
3
310
やさしいとこから始めるGitHubリポジトリのセキュリティ
tsubakimoto_s
3
2k
AIエージェント×GitHubで実現するQAナレッジの資産化と業務活用 / QA Knowledge as Assets with AI Agents & GitHub
tknw_hitsuji
0
270
Amazon Qはアマコネで頑張っています〜 Amazon Q in Connectについて〜
yama3133
1
150
夢の無限スパゲッティ製造機 #phperkaigi
o0h
PRO
0
390
AI時代のオンプレ-クラウドキャリアチェンジ考
yuu0w0yuu
0
570
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
98
Bash Introduction
62gerente
615
210k
Rails Girls Zürich Keynote
gr2m
96
14k
Speed Design
sergeychernyshev
33
1.6k
Docker and Python
trallard
47
3.8k
From π to Pie charts
rasagy
0
160
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
The Spectacular Lies of Maps
axbom
PRO
1
650
The agentic SEO stack - context over prompts
schlessera
0
720
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How to make the Groovebox
asonas
2
2k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
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 です。