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

Nginx Proxy works but cannot access https and wordpress installation #6

Closed
tannerchung opened this issue Sep 20, 2017 · 2 comments
Closed

Comments

@tannerchung
Copy link

The Nginx Proxy seems to be up and running properly:

screenshot_092017_044818_pm

but it seems https is not working:
screenshot_092017_044452_pm

And it seems like the nginx proxy is not routing the domain name to the wordpress instance that's running:

screenshot_092017_044729_pm

Any ideas on what I'm doing wrong?

@tannerchung
Copy link
Author

my nginx proxy:

version: '3'
services:
  nginx:
    image: nginx
    labels:
        com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
    container_name: nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ${NGINX_FILES_PATH}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH}/certs:/etc/nginx/certs:ro

  nginx-gen:
    image: jwilder/docker-gen
    command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    container_name: nginx-gen
    restart: unless-stopped
    volumes:
      - ${NGINX_FILES_PATH}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH}/certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro

  nginx-letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-letsencrypt
    restart: unless-stopped
    volumes:
      - ${NGINX_FILES_PATH}/conf.d:/etc/nginx/conf.d
      - ${NGINX_FILES_PATH}/vhost.d:/etc/nginx/vhost.d
      - ${NGINX_FILES_PATH}/html:/usr/share/nginx/html
      - ${NGINX_FILES_PATH}/certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      NGINX_DOCKER_GEN_CONTAINER: "nginx-gen"
      NGINX_PROXY_CONTAINER: "nginx"

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

wordpress container

version: '3'

services:
   db-xxx:
     container_name: db-xxx
     image: mariadb:latest
     restart: unless-stopped
     volumes:
        - /xxx/db:/var/lib/mysql
     environment:
       MYSQL_ROOT_PASSWORD: ******
       MYSQL_DATABASE: xxx_com
       MYSQL_USER: xxx
       MYSQL_PASSWORD: ******

   wp-xxx:
     depends_on:
       - db-xxx
     container_name: wp-xxx
     build:
       context: ./
     restart: unless-stopped
     expose:
           - "443"
     volumes:
       - ~/xxx/site/:/var/www/html
       - ~/xxx/site/wp-content:/var/www/html/wp-content
       - ~/xxx/site/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
     environment:
       WORDPRESS_DB_HOST: db-xxx:3306
       WORDPRESS_DB_NAME: xxx_com
       WORDPRESS_DB_USER: xxx
       WORDPRESS_DB_PASSWORD: 1enP2TNN5j
       WORDPRESS_TABLE_PREFIX: wp_xxx_
       VIRTUAL_HOST: tanner.com, www.xxx.com
       VIRTUAL_PROTO: https
       VIRTUAL_PORT: 443
       LETSENCRYPT_HOST: xxx.com, www.xxx.com
       LETSENCRYPT_EMAIL: hello@xxx.com

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

@evertramos
Copy link
Owner

Your wordpress container must be on the same network of your proxy:

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

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