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

Feature request: HTTPS redirect #6

Open
christophostertag opened this issue Jun 4, 2020 · 2 comments
Open

Feature request: HTTPS redirect #6

christophostertag opened this issue Jun 4, 2020 · 2 comments

Comments

@christophostertag
Copy link

I use this to avoid using route 53 on aws. The dns CNAME records for the subdomains point straight to the aws loadbalancer domain. However here the issue arises. Using the blank domain (talentsearch.ml) is only possible with an A tag. A tags however can not point to domains, but only IP adresses. This is why I use this proxy to redirect traffic without the subdomain to www. With this current implementation this is only possible for http on port 80. Would it be possible to add support for https on port 443 and let's encrypt certification?

@LuxoftAKutsan
Copy link

LuxoftAKutsan commented Aug 8, 2020

same request, did you find any solution

@fdobrovolny
Copy link

The easiest solution I can think of as the README suggest you can use jwilder/nginx-proxy.

Something like this should work:
(Not tested may have slight syntax errors easy to fix)

version: '3'
services:
  redirect:
    image: morbz/docker-web-redirect
    restart: always
    expose:
      - 80
    environment:
      - VIRTUAL_HOST=myolddomain.net
      - LETSENCRYPT_HOST=myolddomain.net
      - [email protected]
      - REDIRECT_TARGET=mydomain.net

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

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

3 participants