This project serves as a study project to learn how to configure an Nginx instance inside Docker that is exposed through a Tailscale tailnet with a TLS certificate generated by Tailscale. The setup demonstrates how to:
- Run Nginx in a Docker container
- Connect the container to Tailscale
- Generate and use Tailscale TLS certificates
- Configure Nginx to serve content securely
- Docker installed
- Tailscale account and CLI
- Basic understanding of Docker and Nginx configuration
-
Clone this repository:
git clone https://github.com/EduardoThums/tailscale-nginx-tls.git cd tailscale-nginx-tls
-
Generate the TLS certificate on tailscale
cd certificates tailscale cert your-domain.ts.net
-
Build and start the Docker container:
TAILSCALE_HOSTNAME=your-domain.ts.net docker compose up -d
-
Verify the container is running:
docker ps
-
Access your Nginx server through the Tailscale network using the hostname you configured.
curl https://your-domain.ts.net