Skip to content

Instantly share code, notes, and snippets.

View brucejo75's full-sized avatar

Bruce Johnson brucejo75

  • Woodinville, WA
View GitHub Profile

Variables in the Caddyfile

Caddy is a super webserver that has many useful features. Caddy can enable very very powerful scenarios and many of them are documented in this Wiki. As these scenarios become more elaborate (some might say complex!) writing a caddy config file starts to feel more like programming than basic configuration.

When that starts to happen I find myself reaching out for variables to enable multiple scenarios in a single configuration file by manipulating those variables.

For those situations caddy has a few types of variables to consider. What I hope to do here is illuminate how to use these variable types in the Caddyfile.

A note about examples

I will use examples to illustrate the concepts. I use the respond directive to verify how caddy works.

$ vagrant up --debug
 INFO global: Vagrant version: 2.2.14
 INFO global: Ruby version: 2.6.6
 INFO global: RubyGems version: 3.0.3
 INFO global: VAGRANT_DEFAULT_PROVIDER="hyperv"
 INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\2.2.14\\gems\\vagrant-2.2.14\\bin\\vagrant"
 INFO global: VAGRANT_EXPERIMENTAL="cloud_init"
 INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
 INFO global: VAGRANT_INSTALLER_ENV="1"
@brucejo75
brucejo75 / Journal_Mode_Perf_2.md
Created December 1, 2017 01:23
SQLite Journal Mode Perf 2

meteor run, 2 concurrent projects, after meteor reset

App1 journal_mode=WAL:

SQL statement  PRAGMA journal_mode=WAL  took  28
Transaction took:  3
Transaction took:  1
Transaction took:  0
Transaction took:  0
Transaction took:  2
@brucejo75
brucejo75 / Journal_Mode_Perf_1.md
Created December 1, 2017 01:22
SQLite Journal Mode Perf Compare 1

meteor run, 1 project, first run

journal_mode=WAL

SQL statement  PRAGMA journal_mode=WAL  took  27
Transaction took:  2
Transaction took:  1
Transaction took:  0
Transaction took:  0
Transaction took:  2
Transaction took: 0
@brucejo75
brucejo75 / Meteor Load Time.md
Created October 5, 2017 15:24
Meteor load time

Performance Report for Meteor Todo List tutorial App.