Caddyfile.in 1.34 KB
Newer Older
1
# Main caddy configuration file
2 3 4 5 6

import {{frontend_configuration.get('log-access-configuration')}}
import {{ slave_configuration_directory }}/*.conf
import {{ slave_with_cache_configuration_directory }}/*.conf

7
# Catch-all and 404 for not configured instances
8
:{{ https_port }} {
9 10 11
  tls {{ login_certificate }} {{ login_key }}
  bind {{ local_ipv4 }}
  status 404 /
12
  log / {{ access_log }} "{remote} {>REMOTE_USER} [{when}] \"{method} {uri} {proto}\" {status} {size} \"{>Referer}\" \"{>User-Agent}\" {latency_ms}"
13 14 15
  errors {{ error_log }} {
    * {{ not_found_file }}
  }
16 17
}

18 19 20 21 22 23 24 25 26 27
:{{ http_port }} {
  bind {{ local_ipv4 }}
  status 404 /
  log / {{ access_log }} "{remote} {>REMOTE_USER} [{when}] \"{method} {uri} {proto}\" {status} {size} \"{>Referer}\" \"{>User-Agent}\" {latency_ms}"
  errors {{ error_log }} {
    * {{ not_found_file }}
  }
}

# Access to server-status Caddy-style
28 29 30 31 32 33 34 35 36
https://[{{ global_ipv6 }}]:{{ https_port }}/server-status, https://{{ local_ipv4 }}:{{ https_port }}/server-status {
  tls {{ login_certificate }} {{ login_key }}
  bind {{ local_ipv4 }}
  basicauth "{{ username }}" {{ password }} {
    "Server Status"
    /
  }
  expvar
  pprof
37
  log / {{ access_log }} "{remote} {>REMOTE_USER} [{when}] \"{method} {uri} {proto}\" {status} {size} \"{>Referer}\" \"{>User-Agent}\" {latency_ms}"
38 39 40
  errors {{ error_log }} {
    * {{ not_found_file }}
  }
41
}