# 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:** 4

<div class="post-metadata">

**Author:** ![Cameron\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cameron_d/32/97535_2.png) [@Cameron\_D](https://meta.discourse.org/u/Cameron_D)\
**Post date:** [15 ביוני,‏ 2018,‏ 1:10pm UTC](https://meta.discourse.org/t/how-to-deny-request-from-unauthorized-domain-pointing-to-my-ip-address/89970/4 "2018-06-15T13:10:51Z")

</div>

Then adding it to the Discourse nginx config would be the next easiest thing. Using a new pups template would be the best way, to save you needing to re-apply the change every rebuild.

You could try… Make a new file at `/var/discourse/templates/web.403.yml`, with the following contents:

```yml
run:
  - replace:
     filename: "/etc/nginx/conf.d/discourse.conf"
     from: /location / \{/
     to: |
       location / {
         if ($server_name !~ "^forum\.)?example\.com$"){
           return 403;
         }

```

Then edit `/var/discourse/containers/app.yml` and at the bottom of the `templates` section add a new line:

```yml
  - "templates/web.403.yml"

```

And then try and run a `./launcher rebuild app`, see how that goes.

---

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