Skip to content

Instantly share code, notes, and snippets.

@imyelo
Created November 27, 2019 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imyelo/8c07c0f238223b5c4adc69984ea2d214 to your computer and use it in GitHub Desktop.
Save imyelo/8c07c0f238223b5c4adc69984ea2d214 to your computer and use it in GitHub Desktop.
Caddy as a systemd service
[Unit]
Description=Caddy's service
ConditionFileIsExecutable=/usr/local/bin/caddy
[Service]
StartLimitInterval=5
StartLimitBurst=10
LimitNOFILE=102400
ExecStart=/usr/local/bin/caddy "-conf=/etc/caddy/Caddyfile"
Restart=always
RestartSec=120
EnvironmentFile=-/etc/sysconfig/caddy
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment