Preventing Amazon Cloudfront hotlinking

前端 未结 7 1789
孤独总比滥情好
孤独总比滥情好 2020-12-08 15:18

I use Amazon Cloudfront to host all my site\'s images and videos, to serve them faster to my users which are pretty scattered across the globe. I also apply pretty aggressi

7条回答
  •  时光说笑
    2020-12-08 16:04

    You can forward the Referer header to your origin

    1. Go to CloudFront settings
    2. Edit Distributions settings for a distribution
    3. Go to the Behaviors tab and edit or create a behavior
    4. Set Forward Headers to Whitelist
    5. Add Referer as a whitelisted header
    6. Save the settings in the bottom right corner

    Make sure to handle the Referer header on your origin as well.

提交回复
热议问题