Skip to Content

HTTPS with Caddy — Secure Access

HTTPS with Caddy

Automatic SSL certificates for secure access

Your Varyshop is running, but it is only accessible over plain HTTP on port 8069. For a production store, you need HTTPS with a real SSL certificate. Caddy is a modern web server that handles this automatically — no manual certificate management required.

Why Caddy

Automatic HTTPS

Caddy obtains and renews SSL certificates from Let's Encrypt automatically. Zero configuration needed.

Simple Configuration

A Caddy config for reverse proxying is just a few lines. No complex Nginx blocks to write.

HTTP/2 by Default

Caddy serves HTTP/2 out of the box, giving your store faster load times.

Prerequisites

A domain name pointing to your server IP (A record in DNS)
Ports 80 and 443 open in your firewall (we did this earlier)
Varyshop running on port 8069

Add Caddy to Docker Compose

Add to docker-compose.yml
services:
  caddy:
    image: caddy:2
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
    restart: unless-stopped
    depends_on:
      - odoo

volumes:
  caddy_data:
  caddy_config:

Create the Caddyfile

Caddyfile
your-domain.com {
    reverse_proxy odoo:8069
}

That Is the Entire Config

Two lines. Caddy will automatically obtain an SSL certificate, redirect HTTP to HTTPS, and proxy all traffic to your Varyshop container.

Update Odoo Configuration

Remove the ports mapping from the odoo service since Caddy now handles external traffic. Odoo only needs to be accessible internally within the Docker network.

Updated odoo service
  odoo:
    image: varyshop/varyshop:18
    # Remove: ports: - "8069:8069"
    expose:
      - "8069"

Deploy

Restart with Caddy
docker compose down
docker compose up -d
docker compose logs -f caddy
1

Restart the stack

Bring everything down and back up with the new Caddy configuration.

2

Watch Caddy logs

You will see Caddy requesting a certificate from Let's Encrypt. This takes about 30 seconds.

3

Test HTTPS

Open https://your-domain.com in your browser. You should see your Varyshop with a valid SSL certificate.

DNS Propagation

If Caddy fails to obtain a certificate, your domain DNS may not have propagated yet. Wait 5-10 minutes and try again with docker compose restart caddy.

Secure and Live

Your Varyshop is now running behind HTTPS with automatic certificate renewal. Visitors see a green padlock, search engines rank you higher, and payment providers require it. This is production-ready.

Nastavte Caddy jako reverzní proxy s automatickým HTTPS, aktualizujte Docker Compose a ověřte zabezpečený přístup k Varyshop obchodu.

Rating
0 0

There are no comments for now.

to be the first to leave a comment.