# How to forbid direct IP visit to discourse?

**URL:** <https://meta.discourse.org/t/how-to-forbid-direct-ip-visit-to-discourse/27797>\
**Category:** Self-hosting\
**Created:** [4월 21, 2015, 12:48오후 UTC](https://meta.discourse.org/t/how-to-forbid-direct-ip-visit-to-discourse/27797 "2015-04-21T12:48:46Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![doudou](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@doudou](https://meta.discourse.org/u/doudou)\
**Post date:** [4월 21, 2015, 12:48오후 UTC](https://meta.discourse.org/t/how-to-forbid-direct-ip-visit-to-discourse/27797/1 "2015-04-21T12:48:46Z")

</div>

If just only discourse installed on a server, and expose 80 to host, how to forbid direct IP visit to discourse?

If someone visit the direct ip address, how to make it return 500 error.

like:

```plaintext
server {
listen 80 default;
server name _;
return 500;
}

```

If the nginx/conf.d/discourse.conf in the docker changed, is it permanent?

@codinghorror  
@sam

---

_[View the full topic](https://meta.discourse.org/t/how-to-forbid-direct-ip-visit-to-discourse/27797)._
