# \[help\]multisite with letsencrypt-nginx-proxy-companion

**URL:** https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192
**Category:** Self-hosting
**Created:** [May 23, 2018, 2:15am UTC](https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192 "2018-05-23T02:15:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Yule\_Augustine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yule_augustine/32/119951_2.png) [@Yule\_Augustine](https://meta.discourse.org/u/Yule_Augustine)
#### Post date: [May 23, 2018, 2:15am UTC](https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192/1 "2018-05-23T02:15:27Z")

</div>

In my app.yml, make these changes:

Only expose port 80:

```plaintext
expose:
- "80" # fwd host port 80 to container port 80 (http)

```

In the `env:` section, add the latter 3 new lines:

```plaintext
  DISCOURSE_HOSTNAME: 'a.com'
  VIRTUAL_HOST: 'a.com'
  LETSENCRYPT_HOST: 'a.com'
  LETSENCRYPT_EMAIL: a@a.com'

```

Then run `./launer rebuild app`

and my docker-compose.yml looks:

```plaintext
version: '2'

services:

  nginx:
    image: nginx
    volumes:
      - "./etc/nginx/conf.d/:/etc/nginx/conf.d/"
    environment:
      VIRTUAL_HOST: a.com
      LETSENCRYPT_HOST: a.com
      LETSENCRYPT_EMAIL: a@a.com

  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "./nginx/vhost.d:/etc/nginx/vhost.d"
      - "./nginx/html:/usr/share/nginx/html"
      - "./nginx/certs:/etc/nginx/certs"
      - "/var/run/docker.sock:/tmp/docker.sock:ro"

  letsencrypt-nginx-proxy-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    volumes_from:
      - "nginx-proxy"

```

Then i run docker-compose up,when i visit `a.com`,i got 502.  
Waitting for help

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [May 23, 2018, 2:38am UTC](https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192/2 "2018-05-23T02:38:25Z")

</div>

It looks like you messed up the very sensitive yml file (i.e. used tabs instead of spaces to indent)

Try testing it with a linter

> **[YAMLlint - The YAML Validator](https://www.yamllint.com/)**
>
> Validate, Verify and Reformat your YAML documents, optimized for Ruby on Rails

---

<div class="post-metadata">

### Author: ![Yule\_Augustine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yule_augustine/32/119951_2.png) [@Yule\_Augustine](https://meta.discourse.org/u/Yule_Augustine)
#### Post date: [May 23, 2018, 2:47am UTC](https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192/3 "2018-05-23T02:47:26Z")

</div>

thanks first,and it shows: `Valid YAML`

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [May 23, 2018, 4:05am UTC](https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192/4 "2018-05-23T04:05:19Z")

</div>

In that case it might be something to do with your multisite setup.

I just noticed this:  
`Then run ./launer rebuild app`  
that is a “ch” typo, correct?

I guess the next question is what guide(s) did you follow?

---

<div class="post-metadata">

### Author: ![Yule\_Augustine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yule_augustine/32/119951_2.png) [@Yule\_Augustine](https://meta.discourse.org/u/Yule_Augustine)
#### Post date: [May 23, 2018, 4:15am UTC](https://meta.discourse.org/t/help-multisite-with-letsencrypt-nginx-proxy-companion/88192/5 "2018-05-23T04:15:03Z")

</div>

😀 i can visit it use ` http://ip:port`,but when i get 502 with `https://ip:port`
