0

I want to set up multiple websites on a centos 7 machinge using docker + nginx-proxy + multiple httpd + wildcard cert.

I am new to docker,but I have successfully got the multiple sites up and running fine on http, but I am having trouble getting HTTPS to work.

docker run -d -p 80:80 -p 443:443 --name nginx-proxy --net nginx-proxy -e DEFAULT_HOST=default -v /var/run/docker.sock:/tmp/docker.sock:ro -v /usr/local/apache2/conf:/usr/local/apache2/conf:ro --restart always jwilder/nginx-proxy
docker run -d --name default --expose 80 --net nginx-proxy -v /var/www/default:/usr/local/apache2/htdocs/ -e VIRTUAL_HOST=default --restart always httpd:2.4
docker run -d --name doc --expose 80 --net nginx-proxy -v /var/www/doc:/usr/local/apache2/htdocs/ -e VIRTUAL_HOST=doc.mydomain.com --restart always httpd:2.4
docker run -d --name img --expose 80 --net nginx-proxy -v /var/www/img:/usr/local/apache2/htdocs/ -e VIRTUAL_HOST=img.mydomain.com --restart always httpd:2.4

I have read so many forum questions today so I am going nuts over here..

I have the .crt and .key file in the /usr/local/apache2/conf directory.

I have tried to name them default.crt and default.key, also img.mydomain.com.crt and img.mydomain.com.key. it did not work.

I also read that you can define the certificate name using -v CERT_FILE=default if the files are named default.crt and default.key - but still no success.

Please help.

7
  • Why does your stack include both nginx and apache httpd? – jordanm Jun 29 '18 at 14:09
  • About "I have tried to name them default.crt and default.key, also img.mydomain.com.crt and img.mydomain.com.key. it did not work." the names by themselves are purely for human organization the software does not care as long as it is correctly configured with the appropriate names and that the permissions on files are ok. Also you did not really specify what does not work... what do you try and what errors do you get? – Patrick Mevzek Jun 29 '18 at 14:44
  • I am using nginx as proxy and httpd as web server – Niclas H Jun 29 '18 at 19:16
  • Site does not load in Chrome and the error message that I get is ERR_CONNECTION_REFUSED. Firewall ports 80 and 443 is open. I have tried to disable selinux, but did not help.. – Niclas H Jun 29 '18 at 19:17
  • I found this. Read below Ssl support github.com/jwilder/nginx-proxy/blob/master/README.md – Niclas H Jun 29 '18 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.