Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[SSL]VIRTUAL_HOST + (+.crt/.key) does not work for me #74
But the nginx response in the log is:
no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking
What means he found something. \o/ ;-)
When I rename the files to default(.crt/.key) then it works.
What is here wrong?
I had same issue and altered nginx.tpl file by replacing:
in this part:
and it works now.
Did this by making new image, Dockerfile:
I have some problems with your suggested fix. Is anyone of you running more than one docker image with ssl?
If i start one everything is working, but if i start a second container that uses ssl i get the following error in nginx:
[emerg] 35#0: a duplicate default server for 0.0.0.0:443 in /etc/nginx/conf.d/default.conf:243
and it does not connect the second container to nginx. Any ideas?
How are you testing this fix? I tried to update the template after pulling and running the trusted image and ran into the same issue. When I built from the repo (git clone https://github.com/jwilder/nginx-proxy.git) it worked with no changes (since this fix was already in the repo).
edit: I have noticed that the nginx-proxy container needs to be restarted after adding an SSL cert or it directs the new one to the first site.
@log0ymxm The behaviour is really strange. Now i am using the nginx-proxy without the fix suggested here and the following does work:
when you provide an crt and key for default AND the virtual host ssl is working. if you only have one of both ssl is not working. However i don't know which cert nginx is using, but it does not use the else branch in the template since the "Strict-Transport-Security" header is set. Maybe this is helpful for someone to investigate further.
As I mentioned, it works fine for me with multiple (9 non-ssl and 3 SSL) sites. I cloned the repo and performed a docker build before running the container. I suggest stop & start each time an SSL container is added as the dynamic doesn't seem to work correctly though I haven't had time to inspect the config files and determine why.
@Nitesedge Ah, I overread your response, sorry. I tested the trusted containter from the docker hub, which has this issue and then cloned the repo and applied this fix. This fix here is not included as far as i can see it in the nginx template, but i will try to build the Dockerfile from the repo as you suggested. Thanks for the tip.
added a commit
Jan 22, 2015
referenced this issue
Jan 22, 2015
I get the
One workaround seems to be to add a
It seems that in nginx it is not allowed to have a
did the trick for me. Of course you'll potentially get the contents of a different site when connecting with https to a site which does not have a certificate.