# Difference between socket- and port-based connection to outer NGINX?

**URL:** <https://meta.discourse.org/t/difference-between-socket-and-port-based-connection-to-outer-nginx/60071>\
**Category:** Self-hosting\
**Created:** [29. März 2017 um 00:09 UTC](https://meta.discourse.org/t/difference-between-socket-and-port-based-connection-to-outer-nginx/60071 "2017-03-29T00:09:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)\
**Post date:** [29. März 2017 um 00:09 UTC](https://meta.discourse.org/t/difference-between-socket-and-port-based-connection-to-outer-nginx/60071/1 "2017-03-29T00:09:05Z")

</div>

If I understand things correctly there are two ways of configuring your discourse instance behind an NGINX server:

1. with a socket connection (as described [here](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247))
2. by exposing some port of the container and telling the outer NGINX to forward traffic for discourse to that port (as suggested [here](https://blog.khophi.co/install-run-discourse-behind-nginx-right-way-first-time/) and [here](https://www.digitalocean.com/community/questions/need-help-with-installing-discourse-and-wordpress)).

Since the [how-to here on meta](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247) uses the socket method, I suppose that is the preferred method. But what exactly are the benefits compared to the port-method?

I can’t seem to get the the socket version to work even though I followed the [instructions here](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247). I just get ERR\_CONNECTION\_REFUSED when trying to access the discourse subdomain. Other webpages served by the same NGINX are working fine.

---

_[View the full topic](https://meta.discourse.org/t/difference-between-socket-and-port-based-connection-to-outer-nginx/60071)._
