# Disable direct access with port (nginx)

**URL:** https://meta.discourse.org/t/disable-direct-access-with-port-nginx/31312
**Category:** Self-hosting
**Created:** [2015 年7 月 22 日 20:40 UTC](https://meta.discourse.org/t/disable-direct-access-with-port-nginx/31312 "2015-07-22T20:40:22Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [2015 年7 月 22 日 21:21 UTC](https://meta.discourse.org/t/disable-direct-access-with-port-nginx/31312/2 "2015-07-22T21:21:39Z")

</div>

Your can use a firewall like `iptables` to block access to this port.

Alternatively, you can follow [this guide](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247) to use a socket instead of a port, eliminating the need to block any port 🙂

---

_[View the full topic](https://meta.discourse.org/t/disable-direct-access-with-port-nginx/31312)._
