A simple framework to expose you linux http services as https using Let's Encrypt certificates and nginx running in a docker container.
- Make sure you have you backend services running on the local host listening to some ports
- Make sure your firewall rules are set to allow incoming external HTTP and HTTPS traffic to the host.
- Clone this repository or download its contents to a suitable directory. (How about
/opt/letsexpose
?) - Copy
config/config.sample.yaml
toconfig/config.yaml
and edit the file to suit your needs. The sample file has plenty of comments. Don't forget to use your own e-mail address and setstaging
tofalse
! - Run
sudo install.sh
and follow the instructions. This script will ask for confirmation before each step!
An nginx container running under docker compose does two things:
- A server on port 80 handles
- challenge requests from Let's encrypt
- other http requests by redirecting them on to the corresponding https URLs.
- Server(s) running HTTPS to reverse proxy into local services
Protecting services with single user basic http auth is also supported.
Note that the nginx container runs using "host networking" in order to access the local services.
The letsexpose framwork was written by David Björkevik under funding by Envista. It more or less implements the method described in this medium.com article by user Philipp.