LoginSignup
0
0

More than 3 years have passed since last update.

CDNETWORKS CDNでリクエストCookieの値によるコンテンツの配信制限・許可してみた

Last updated at Posted at 2020-06-12

期待する挙動としては、制限したいコンテンツを指定しCookieの値が無い場合は指定コンテンツにリダイレクトさせます。

挙動
■Cookieに指定した値(dasu=ok)がある場合以下のキャッシュされたコンテンツを配信する
http://test-cdn.cdngc.net/images/test/ok.jpg

*Cookieにdasu=okつけたらOK画像でるよ!

Cookieの値が無い場合以下のコンテンツに302リダイレクト
(*この場合遷移先Locationが記載される302はキャッシュしないようご注意):
http://test-cdn.cdngc.net/images/no.jpg

実際の設定
ポータルに入ってから
■Configulation → FQDN選択 → Anti Hotlinking →

Untitled-2.gif

確認
Cookieにdasu=okを挿入しアクセス。
OKコンテンツでの200レスポンスを確認。

cookie_ok.gif

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0