npx vratix init
Our Node.js template includes a minimal NGINX configuration that works out-of-the-box for most deployments, but you can expand it as needed.
The default template does not include SSL support. Below are detailed instructions on setting up SSL with Let's Encrypt.
SSL Setup (Optional)
SSL certificates are generated on the host and then mounted into the NGINX Docker container.
1. Install Certbot and Generate SSL Certificates
- Install Certbot (Let's Encrypt client) on your host if it’s not already installed:
- Generate SSL certificates for your domain. Replace
yourdomain.com
with your actual domain name:
Certificates will be stored in /etc/letsencrypt/live/yourdomain.com/
.
2. Update nginx.conf
for SSL
Modify your nginx.conf
to enable SSL:
- Add an HTTPS server block in
nginx.conf
, configured as follows:
- Add an HTTP to HTTPS redirect block (optional):
3. Mount Certificates in Docker
Ensure SSL certificates are available to the NGINX container by mounting them in docker-compose.yml
.
Replace yourdomain.com
with your domain name:
4. Automate SSL Renewal
- Open your crontab to add an automated renewal job:
- Add the renewal command to run daily at 3 AM (or adjust the schedule as desired):
This setup will check for certificate renewal daily and restart NGINX if renewal occurs.