tiredofit/docker-nginx-php-fpm

SSL HTTPS 443 port

perarg opened this issue · 3 comments

Hello,

i use https://github.com/jwilder/nginx-proxy for nginx proxy and this container for serving content. I use Let'sEncrypt SSL certificate so i need the proxy to call <my_docker_ipAddress>:443

But in this container only 80 is exposed. If i use in my docker-compose.yml file

ports:
  - "443"

i get a 503 Bad Gateway. I suppose this is happening because it doesn't know where to go in this container through port 443.

You are right, I am only serving port 80 and exposing port 80 in Dockerfile. I use the jwilder/nginx-proxy as well and to make this work I set the environment variable of VIRTUAL_PORT to 80. Here's an example:

    - VIRTUAL_HOST=nginx.hostname.com
    - VIRTUAL_NETWORK=nginx-proxy
    - VIRTUAL_PORT=80
    - LETSENCRYPT_HOST=nginx.hostname.com
    - LETSENCRYPT_EMAIL=user@hostname.com

Sorry, I should add to this, I also use the JrCS/nginx-proxy-letsencrypt-companion which automatically generates certificates based on those environment variables.

Closing due to inactivity