Closed jujes closed 8 years ago
Hi @jujes,
I have used the jwilder/nginx-proxy
reverse proxy in the past and I believe using the reverse proxy in this project will help you much. You can run the jwilder/nginx-proxy
outside of this project to run multiple sites on the port 80/443 with the same IP. Then you could change the port configuration of the nginx container to this:
nginx:
image: nginx:latest
ports:
- "80"
- "443"
links:
- "php"
volumes:
- /home/vagrant/up/proxy/vhost.d:/etc/nginx/vhost.d:ro
- /home/vagrant/up/proxy/certs:/etc/nginx/certs
- /var/run/docker.sock:/tmp/docker.sock:ro
volumes_from:
- php
... you no longer have to bind port 80 and 443. But I cannot give you a full example since I haven't used the jwilder/nginx-proxy
in a while.
But I can highly recommend: Traefik All you have to do is add some labels to your web container and you are good to go:
version: '2'
services:
caddy:
image: abiosoft/caddy:latest
volumes:
- ./public:/srv
- ./Caddyfile:/etc/Caddyfile
labels:
- "traefik.port=80"
- "traefik.frontend.rule=Host:ak7.io,www.ak7.io"
- "traefik.protocol=http"
- "traefik.frontend.entryPoints=http,https"
or
version: '2'
services:
web:
image: nginx:1-alpine
volumes:
- ./config/nginx/conf.d:/etc/nginx/conf.d:ro
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
volumes_from:
- phpfpm:ro
networks:
- front
- back
labels:
- "traefik.port=80"
- "traefik.frontend.rule=Host:wambo.co,www.wambo.co"
- "traefik.protocol=http"
- "traefik.frontend.entryPoints=http,https"
- "traefik.frontend.passHostHeader=true"
phpfpm:
image: php:7-fpm-alpine
volumes:
- ./web:/var/www/html
networks:
- back
networks:
front:
driver: bridge
back:
driver: bridge
Hi, someone know how fix this issue? I'm deploying with jwilder/nginx-proxy https://github.com/jwilder/nginx-proxy
here my docker-compose.yml
thanks in advance! :)