# How to deny request from unauthorized domain pointing to my IP address?

**URL:** <https://meta.discourse.org/t/how-to-deny-request-from-unauthorized-domain-pointing-to-my-ip-address/89970>\
**Category:** Product Support\
**Created:** [15 ביוני,‏ 2018,‏ 12:44pm UTC](https://meta.discourse.org/t/how-to-deny-request-from-unauthorized-domain-pointing-to-my-ip-address/89970 "2018-06-15T12:44:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Gulshan\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gulshan_kumar/32/119562_2.png) [@Gulshan\_Kumar](https://meta.discourse.org/u/Gulshan_Kumar)\
**Post date:** [15 ביוני,‏ 2018,‏ 12:44pm UTC](https://meta.discourse.org/t/how-to-deny-request-from-unauthorized-domain-pointing-to-my-ip-address/89970/1 "2018-06-15T12:44:39Z")

</div>

Any XYZ domain which points to my Digital Ocean droplet IP, it redirects to my forum. This way it has created a lot of uknown 404 logs and affecting link profile.

I am thinking to add a rule like this

```
location / {
  if ($server_name !~ "^forum\.)?example\.com$"){
    return 403;
  }
}

```

which mean deny request from unauthorized domain

Please guide me how can I add?

Thanks & Regards,  
Gulshan

---

_[View the full topic](https://meta.discourse.org/t/how-to-deny-request-from-unauthorized-domain-pointing-to-my-ip-address/89970)._
