Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose configuration returning 404 #48

Closed
ddelizia opened this issue Apr 9, 2016 · 1 comment
Closed

Docker compose configuration returning 404 #48

ddelizia opened this issue Apr 9, 2016 · 1 comment

Comments

@ddelizia
Copy link

ddelizia commented Apr 9, 2016

I'm trying to deploy a prestashop container and want to add https + letsencrypt using the container you built.

i copied the nginx.tmpl from https://github.com/fatk/docker-letsencrypt-nginx-proxy-companion-examples/blob/master/volumes/proxy/templates/nginx-compose-v2.tmpl and

I followed instruction from your example https://github.com/fatk/docker-letsencrypt-nginx-proxy-companion-examples/blob/master/docker-compose/v2/simple-site/docker-compose.yml but I get default nginx page (no prestashop is accessible). If I try mysite.com:8090 I can successfully access prestashop instance.
Here I copied some log from console:

nginx                             | 2016/04/09 12:02:26 [emerg] 1#1: no host in upstream ":80" in /etc/nginx/conf.d/default.conf:35
.....
nginx                             | 52.49.150.5 - - [09/Apr/2016:12:03:43 +0000] "GET / HTTP/1.1" 200 612 "-" "Wget/1.16.1 (linux-gnu)" "-"
nginx                             | 2016/04/09 12:04:58 [error] 6#6: *2 open() "/usr/share/nginx/html/install" failed (2: No such file or directory), client: 52.49.150.5, server: localhost, request: "GET /install13111984 HTTP/1.1", host: "mysite.com"
nginx                             | 52.49.150.5 - - [09/Apr/2016:12:04:58 +0000] "GET /install HTTP/1.1" 404 169 "-" "Wget/1.16.1 (linux-gnu)" "-"

here is my docker compose file

version: '2'
services:

  nginx:
    image: nginx
    container_name: nginx
    ports:
      - "80:80"
      - "443:443"
    restart: always
    volumes:
      - /etc/nginx/conf.d
      - /etc/nginx/vhost.d
      - /usr/share/nginx/html
      - certs:/etc/nginx/certs:ro
    networks:
      - proxy-tier

  nginx-gen:
    image: jwilder/docker-gen
    container_name: nginx-gen
    volumes_from:
      - nginx
    restart: always
    volumes:
      - /home/ubuntu/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -only-exposed -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf

  letsencrypt-nginx-proxy-companion:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: letsencrypt-nginx-proxy-companion
    restart: always
    environment:
       - NGINX_DOCKER_GEN_CONTAINER=nginx-gen
    volumes_from:
      - nginx
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - certs:/etc/nginx/certs:rw

  prestashop:
    image: prestashop/prestashop
    container_name: prestashop
    ports:
      - "8090:80"
    restart: always
    environment:
      - VIRTUAL_HOST=mysite.com
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=mysite.com
      - LETSENCRYPT_EMAIL=email@mysite.com

    networks:
      - proxy-tier

volumes:
  certs: {}

networks:
  proxy-tier:
    external:
      name: nginx-proxy

@JrCs
Copy link
Collaborator

JrCs commented Apr 9, 2016

Like said in the REAME of the example site: https://github.com/fatk/docker-letsencrypt-nginx-proxy-companion-examples#docker-compose-v2 you need an unofficial version of nginx.tmpl to use version 2 of docker-compose.

@JrCs JrCs closed this as completed Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants