Serving a Dockerized web app over https on Synology
posted in docker on • by Wouter Van Schandevijl •You’ve developed the most fancy application and are running it on your Synology in a Docker container.
But you really don’t want that ugly “Not secure” when opening it. This series goes over your options, starting with the easiest one to setup: using the Synology nginx.
Open Synology DSM and
Step 1: Setup Reverse Proxy
Control Panel > Login Portal > Advanced > Reverse Proxy > Create
Reverse Proxy Rules:
- Pick a “Reverse Proxy Name”
- Source
- Protocol: HTTPS
- Hostname: *
- Port: some port
- Check “Enable HSTS”
- Destination
- Protocol: HTTP
- Hostname: localhost
- Port: port exposed by your docker container
- Save
Step 2: Create Certificate
Control Panel > Security > Certificate > Add
- Add a new certificate > Next
- Enter a “Description”
- Get a certificate from Let’s Encrypt
- Domain name: your-syno.synology.me
- Email: your email
You can reuse the same certificate for multiple Docker containers.
Step 3: Use Certificate
Control Panel > Security > Certificate > Settings
- Service: As defined in Step 1 Source Hostname:Port
- ex: *:some port
- Certificate: Select the Certificate created in Step 2
https://your-syno.synology.me:some_port
should now work!
This configuration is written to /etc/nginx/sites-enabled/server.ReverseProxy.conf
Other interesting reads