# 호스트에서 VM의 Discourse 서버에 접속할 수 없음

**URL:** <https://meta.discourse.org/t/cant-reach-discourse-server-in-vm-from-host/154151>\
**Category:** Development\
**Created:** [6월 8, 2020, 5:12오전 UTC](https://meta.discourse.org/t/cant-reach-discourse-server-in-vm-from-host/154151 "2020-06-08T05:12:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [6월 8, 2020, 2:43오후 UTC](https://meta.discourse.org/t/cant-reach-discourse-server-in-vm-from-host/154151/5 "2020-06-08T14:43:44Z")

</div>

> [@Hugo\_Lol](#):
>
> `bundle exec rails server --binding=0.0.0.0`

여기서 문제는 `--binding` 옵션이 완전히 무시된다는 것입니다. 로컬에서 해당 명령어를 실행해 보니 출력 결과에 이 줄이 있었습니다(출력 내용이 매우 방대해서 이 줄을 놓치기 쉽습니다):

```plaintext
I, [2020-06-08T17:26:55.938086 #21001] INFO -- : listening on addr=127.0.0.1:3000 fd=15

```

`config/unicorn.conf.rb` 파일을 살펴보면, 서버가 `0.0.0.0`을 수신하도록 하려면 `UNICORN_BIND_ALL=1` 환경 변수를 설정해야 합니다. 따라서 이렇게 하면 작동해야 합니다: `UNICORN_BIND_ALL=1 bundle exec rails server`.

대신 `bin/unicorn` 스크립트를 사용할 수도 있으며, 이 스크립트는 `0.0.0.0`에 바인딩하는 데 사용할 수 있는 `--host` 옵션을 지원합니다.

---

_[View the full topic](https://meta.discourse.org/t/cant-reach-discourse-server-in-vm-from-host/154151)._
