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
380
0
Share
「/」がウザい / 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
31
Azure OpenAIのコンテンツフィルターを学ぶ
jkudo
0
2k
Azure Policyから始めるガバナンス
jkudo
0
790
5分で解るかもしれないMicrosoft Ignite 2023でのServerless関連アップデート
jkudo
0
600
第42回 Tokyo Jazug Night - ネットワークを伸ばせどこまでも
jkudo
0
640
Dynatrace デモ (Azure)
jkudo
0
680
Other Decks in Technology
See All in Technology
Chasing Real-Time Observability for CRuby
whitegreen
0
200
扱える不確実性を増やしていく - スタートアップEMが考える「任せ方」
kadoppe
0
320
これからの「データマネジメント」の話をしよう
sansantech
PRO
0
140
AI バイブコーティングでキーボード不要?!
samakada
0
600
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
140
260422_Sansan_Tech_Talk__関西_vol.3_データ活用のリアル__矢田__.pdf
sansantech
PRO
0
110
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
8
2.3k
AIでAIをテストする - 音声AIエージェントの品質保証戦略
morix1500
1
130
音声言語モデル手法に関する発表の紹介
kzinmr
0
130
インターネットの技術 / Internet technology
ks91
PRO
0
210
AIを共同作業者にして書籍を執筆する方法 / How to Write a Book with AI as a Co-Creator
ama_ch
2
140
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
4
1.4k
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
280
Become a Pro
speakerdeck
PRO
31
5.9k
Practical Orchestrator
shlominoach
191
11k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
Abbi's Birthday
coloredviolet
2
7.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
Thoughts on Productivity
jonyablonski
76
5.1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
160
Designing for Timeless Needs
cassininazir
0
200
How to Think Like a Performance Engineer
csswizardry
28
2.6k
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 です。