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 logsSet 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.exampleStart up Nginx
docker compose upStart 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.exampleOr set up an alias:
alias http="http --verify=\"$(mkcert --CAROOT)/rootCA.pem\""