# Nginx - hotlinking

**URL:** <https://www.ruby-forum.com/t/nginx-hotlinking/212595>\
**Category:** NGINX\
**Created:** [October 7, 2011, 12:25pm UTC](https://www.ruby-forum.com/t/nginx-hotlinking/212595 "2011-10-07T12:25:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 7, 2011, 12:25pm UTC](https://www.ruby-forum.com/t/nginx-hotlinking/212595/1 "2011-10-07T12:25:27Z")

</div>

Hi Igor S.,

Could you please help how to stop badguys from hotlinking my images.

I try a lot of code and nothing happens

I don’t know which file to edit

I use this code in sudo nano /usr/local/nginx/sites-available/

> **[开云手机APP(中国)开云有限公司官网](https://www.elestandard.com/)**
>
> 开云手机APP(中国)开云有限公司官网基于工业互联网平台实践,全价值链云服务,《新闻百态,开云手机app》为大中型企业提供汽车,快消,家居智能制造,数字工厂,农牧数字化转型等领域的云产品与解决方案,赋予企业互联网化、移动化、智能化.

# Stop deep linking or hot linking

location /uploads/ {  
valid\_referers none blocked [www.example.com](http://www.example.com) [example.com](http://example.com);  
if ($invalid\_referer) {  
return 403;  
}  
}

But I’m always have an error.

I’ll appreciate your help.

thank you very much!

---

<div class="post-metadata">

**Author:** ![SSIngSGunther\_FlS\_t](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9d8465/32.png) [@SSIngSGunther\_FlS\_t](https://www.ruby-forum.com/u/SSIngSGunther_FlS_t)\
**Post date:** [October 7, 2011, 7:36pm UTC](https://www.ruby-forum.com/t/nginx-hotlinking/212595/2 "2011-10-07T19:36:03Z")

</div>

Try posting your full config, it must be matching another location  
perhaps.  
Otherwise it looks fine.
