Skip to content

Nginx reverse proxy of localhost:8080 && `mkcert` wrapped in Docker Compose

Notifications You must be signed in to change notification settings

bdemers/localhost-tls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

localhost TLS

Access services on localhost:8080 via https://local.example using mkcert and Nginx.

Add local.example to hosts file:

sudo sh -c 'echo "127.0.0.1 local.example" >> /etc/hosts'

Create directories:

mkdir devcerts
mkdir logs

Set up certificates with mkcert

# Install mkcert if needed
brew install mkcert

mkcert --install
mkcert -key-file devcerts/key.pem -cert-file devcerts/cert.pem local.example

Start up Nginx

docker compose up

Start your application on port 8080

Access your service from https://local.example

NOTE: HTTPie does NOT use the system certificates, you must point to the mkcert's directly

http --verify="$(mkcert --CAROOT)/rootCA.pem" https://local.example

Or set up an alias:

alias http="http --verify=\"$(mkcert --CAROOT)/rootCA.pem\""

About

Nginx reverse proxy of localhost:8080 && `mkcert` wrapped in Docker Compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published