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
390
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
「/」がウザい / Take measures on the trailing slash in WebApps
Japan Azure User Group 11周年イベント LT資料
WebAppsの「/」について解説とリダイレクトの対策
Jun Kudo
September 25, 2021
More Decks by Jun Kudo
See All by Jun Kudo
Azure AI Service を支えるAI Platform とはなんけ?
jkudo
0
42
Azure OpenAIのコンテンツフィルターを学ぶ
jkudo
0
2k
Azure Policyから始めるガバナンス
jkudo
0
840
5分で解るかもしれないMicrosoft Ignite 2023でのServerless関連アップデート
jkudo
0
620
第42回 Tokyo Jazug Night - ネットワークを伸ばせどこまでも
jkudo
0
650
Dynatrace デモ (Azure)
jkudo
0
720
Other Decks in Technology
See All in Technology
Microsoft MVP プログラムを紹介するから目指す人増えてくれ
tsubakimoto_s
0
160
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
54k
サービス内で複数のOP・ASを連鎖させる(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
390
現場の暗黙知を継承するAIエージェント — 対話から生まれる長期記憶と Skills
atsukish
0
170
分割40%キーボードにスムーズに入門するには
hoto17296
1
200
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3.2k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
5k
dbt と Snowflake と tag
kevinrobot34
2
310
dbt in Microsoft Fabric
ryomaru0825
0
310
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
8
1.7k
OAuth SPIFFE Client Authentication(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
380
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.3k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
490
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
220
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Agile that works and the tools we love
rasmusluckow
331
22k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
490
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
500
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
400
Building Adaptive Systems
keathley
44
3.2k
The Curse of the Amulet
leimatthew05
2
14k
A Soul's Torment
seathinner
7
3.5k
Leo the Paperboy
mayatellez
8
2.2k
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 です。