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


(Yule Augustine) #1

In my app.yml, make these changes:

Only expose port 80:

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

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

  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:

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


(Mittineague) #2

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

http://www.yamllint.com/


(Yule Augustine) #3

thanks first,and it shows: Valid YAML


(Mittineague) #4

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?


(Yule Augustine) #5

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