Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Using Jwilder Nginx Reverse Proxy With Wildcard SSL Certificate

You will often find that there are docker images for web services that you want, but they often don't have support for SSL. For these cases you need to implement some sort of reverse proxy, with the proxy handling the SSL certificates. A popular reverse proxy is the jwilder/nginx-proxy.

I struggled to get this to work because I was providing my own certificate, and it was a wildcard certificate, instead of one specific to the domain I was pointing to. Hence I am posting the solution I found.


The docker-compose.yml file below is for a site at that is using a wildcard certificate for (e.g. *, but we call the certificate and (you need to use the .crt and .key naming convention for this to work). Those certificate files are in a folder at $HOME/ssl.

version: '2.2'

    image: jwilder/nginx-proxy
    restart: always
      - "80:80"
      - "443:443"
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - $HOME/ssl:/etc/nginx/certs

    image: httpd
      - VIRTUAL_PROTO=http
      - VIRTUAL_PORT=80


Last updated: 8th August 2020
First published: 25th June 2020