Skip to content
Dockerised Jenkins with SSL support using nginx and letsencrypt
Branch: master
Clone or download
rathko Merge pull request #1 from schmengler/reverse-proxy-configuration
Set X-Forwarded-Proto header to HTTPS
Latest commit c894c58 Jul 29, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
etc/nginx/conf.d Set X-Forwarded-Proto header to HTTPS Jul 26, 2018 Updated docs Aug 27, 2017


Dockerised Jenkins with SSL support using Nginx and Let's Encrypt


Docker and docker-compose:


Your domain needs to be publicly resolvable and accessible from the internet.

Modify the domain and e-mail address inside the docker-compose.yml:

# Used by `nginx-proxy` to automatically proxy the traffic to the `nginx` docker
# Used by `letsencrypt-nginx-proxy-companion` to generate SSL certificates

Bring up the services:

docker-compose up

Access your jenkins on: Note that on the first run it could take few minutes to initialise the Let's Encrypt.

Local testing

For development purposes, you could run boulder, the CA server behind Let's Encrypt:

Alternatively you can use Their free service is sufficient to test this example.

  • Register with and download ngrok app
  • Run locally ngrok http 80 and note
  • Replace inside docker-compose.yml with and with your e-mail address
  • Add to your /etc/hosts the mapping to the ngrok domain: You need this step, otherwise your call to this domain will be routed through
  • Run docker-compose up

What happens after running this example is the following:

  • Let's encrypt will generate new certificate
  • It will call which will be redirected to our localhost, courtesy of You can confirm this behaviour when checking: http://localhost:4040/inspect/http
  • Navigate to and setup your Jenkins.


You can’t perform that action at this time.