These may not work with Caddy v2.

Redirect Everything to HTTPS

1
2
3
4
5
6
7
8
9
http://www.domain.com, http://domain.com, https://domain.com {
  redir https://www.domain.com{uri}
}

https://domain.com {
  root FOLDER
  gzip
  header / -server
}

Using Godaddy Certificates

To get a perfect ssllabs SSL Report, append the GoDaddy Secure Server Certificate (Intermediate Certificate) to your certificate.

1
2
wget https://ssl-ccp.godaddy.com/repository/gdig2.crt.pem
cat gdig2.crt.pem >> server.crt
1
2
3
4
5
6
https://yannick.dev {
  root yannick.dev
  gzip
  header / -server
  tls certificates/server.crt certificates/server.key
}

Proxy requests to another API service

1
2
3
4
5
6
proxy /api/register localhost:8180 {
  proxy_header X-Forwarded-Proto {scheme}
  proxy_header X-Forwarded-For {host}
  proxy_header X-Real-IP {remote}
  proxy_header Host {host}
}