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
330
「/」がウザい / 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
10
Azure OpenAIのコンテンツフィルターを学ぶ
jkudo
0
1.5k
Azure Policyから始めるガバナンス
jkudo
0
630
5分で解るかもしれないMicrosoft Ignite 2023でのServerless関連アップデート
jkudo
0
500
第42回 Tokyo Jazug Night - ネットワークを伸ばせどこまでも
jkudo
0
570
Dynatrace デモ (Azure)
jkudo
0
570
Other Decks in Technology
See All in Technology
AWSLambdaMCPServerを使ってツールとMCPサーバを分離する
tkikuchi
1
3k
システムとの会話から生まれる先手のDevOps
kakehashi
PRO
0
280
ブラウザのレガシー・独自機能を愛でる-Firefoxの脆弱性4選- / Browser Crash Club #1
masatokinugawa
1
470
Devinで模索する AIファースト開発〜ゼロベースから始めるDevOpsの進化〜
potix2
PRO
7
3.4k
Spring Bootで実装とインフラをこれでもかと分離するための試み
shintanimoto
7
820
バクラクの認証基盤の成長と現在地 / bakuraku-authn-platform
convto
1
560
AIでめっちゃ便利になったけど、結局みんなで学ぶよねっていう話
kakehashi
PRO
0
140
[2025年4月版] Databricks Academy ラボ環境 利用開始手順 / Databricks Academy Labs Onboarding
databricksjapan
0
140
SREの視点で考えるSIEM活用術 〜AWS環境でのセキュリティ強化〜
coconala_engineer
1
290
Automatically generating types by running tests
sinsoku
2
3k
SmartHR プロダクトエンジニア求人ガイド_2025 / PdE job guide 2025
smarthr
0
120
コスト最適重視でAurora PostgreSQLのログ分析基盤を作ってみた #jawsug_tokyo
non97
0
110
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Done Done
chrislema
183
16k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
How to Think Like a Performance Engineer
csswizardry
23
1.5k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
The World Runs on Bad Software
bkeepers
PRO
67
11k
GraphQLとの向き合い方2022年版
quramy
46
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
13
670
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 です。