{
  # debug
  # auto_https disable_redirects
  # auto_https off
}

localhost, code-basics.test {
  # root /packs/* /etc/caddy/public/packs

  # log {
  #   format single_field common_log
  # }

  encode gzip
  tls internal

  reverse_proxy web:3000
}

# TODO: try it with regular expressions

http://hexletdev.com,
http://hexletdev2.com,
http://hexletdev3.com,
http://hexletdev4.com,
http://hexletdev5.com,
http://hexletdev6.com,
http://hexletdev7.com {
  # root /packs/* /etc/caddy/public/packs

  encode gzip

  # header {
  #   Access-Control-Allow-Origin *
  #  # Referrer-Policy unsafe-url
  # }
  # https://github.com/caddyserver/caddy/issues/2550

  reverse_proxy web:3000 {
    header_up X-Forwarded-Proto https
  }
}
