# Restrict Discourse to IP range

**URL:** https://meta.discourse.org/t/restrict-discourse-to-ip-range/69963
**Category:** Support
**Created:** [September 13, 2017, 1:51pm UTC](https://meta.discourse.org/t/restrict-discourse-to-ip-range/69963 "2017-09-13T13:51:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Raphael\_Haase\_NL](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Raphael\_Haase\_NL](https://meta.discourse.org/u/Raphael_Haase_NL)
#### Post date: [September 13, 2017, 1:51pm UTC](https://meta.discourse.org/t/restrict-discourse-to-ip-range/69963/1 "2017-09-13T13:51:19Z")

</div>

We want to try out Discourse by deploying it on Azure, but restricting access to certain IP ranges, i.e. so that only HTTP requests coming from a certain IP range are answered by Discourse, whereas others only get a 403 or so and do not see any content.  
Is there an easy way to configure Discourse in this way?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 13, 2017, 2:11pm UTC](https://meta.discourse.org/t/restrict-discourse-to-ip-range/69963/2 "2017-09-13T14:11:19Z")

</div>

You could configure firewall stuff on azure to just not respond. You could configure nginx to do the same. Neither really has much to do with Discourse.

What most people do is just turn on the login required site setting and turn off the ability to request accounts.

---

<div class="post-metadata">

### Author: ![Raphael\_Haase\_NL](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Raphael\_Haase\_NL](https://meta.discourse.org/u/Raphael_Haase_NL)
#### Post date: [September 13, 2017, 3:42pm UTC](https://meta.discourse.org/t/restrict-discourse-to-ip-range/69963/3 "2017-09-13T15:42:04Z")

</div>

I configured the Azure virtual machine inbound rules. This did the trick. Thanks!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [September 13, 2017, 4:14pm UTC](https://meta.discourse.org/t/restrict-discourse-to-ip-range/69963/4 "2017-09-13T16:14:05Z")

</div>


