[Help] Working SSL on localhost?
Hi, first of all it's more likely that this is not an issue, probably I did something wrong (I'm not an expert!) :D What I'm trying to do is to have the jwilder proxy container to route all my requests! And for now it's working! I have the proxy container, then a laravel installation (laradock) and some more lamp containers with other small websites. Everyone have their VIRTUAL_HOST set and all those virtual hosts redirect on 127.0.0.1 (edited host file). What I can't do is to get working HTTPS on my computer (OSX with native docker); i'm trying with https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion but maybe I'm doing something wrong... Do you have some advices on how to get this done correctly? Thanks!
Let's encrypt won't issue an SSL cert for localhost. There's nothing you can do about that.
here's my workaround. Let's assume you own domain example.com.
- in your DNS you make A record *.local.example.com -> 127.0.0.1
- go to letsencrypt and get *.local.example.com wildcard cert.
- put this certificates into certs folder and name them site.local.example.com.chain.crt site.local.example.com.crt site.local.example.com.key
- in docker-compose you set env VIRTUAL_HOST: site.local.example.com
You don't need letsencrypt-nginx-proxy-companion for this.
I would say that it's definitely possible. Go through this tutorial to generate root ssl cert and "localhost" domain cert: https://medium.freecodecamp.org/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec
After that just add rootCA.pem to your trusted Authorities in Chrome.
And that's it. "https://localhost/" with secure connection. Just put the localhost.key and localhost.crt in the same directory where letsencrypt created default.key. In my case it was: "- ./certs:/etc/nginx/certs:rw"
This repo should no longer handle issues or discussions related to nginx-proxy / the nginx-proxy template, unless there is something we need to change / fix in docker-gen in order to allow a change / fix in nginx-proxy.