How to allow aws s3 bucket contents only to publicly serve a certain domain?


I am using aws s3 to store my website pictures and video contents. File links from s3 are directly output to html/php.

The problem is that some other sites linked my picture/video, which heavily increased s3 traffic usage, and off course increased the pay bill.

I know in some case people use referer header to prohibit external sites linking. But in this case, picture/video go out directly from s3, not my domain.

Can some one help to achieve this? Thanks.


You can use Amazon bucket policy like :

which is explained in detail at :

Leave a Reply