37 lines
977 B
INI
37 lines
977 B
INI
# caddy.service
|
|
#
|
|
# For using Caddy with a config file.
|
|
#
|
|
# Make sure the ExecStart and ExecReload commands are correct
|
|
# for your installation.
|
|
#
|
|
# WARNING: This service does not use the --resume flag, so if you
|
|
# use the API to make changes, they will be overwritten by the
|
|
# Caddyfile next time the service is restarted. If you intend to
|
|
# use Caddy's API to configure it, add the --resume flag to the
|
|
# `caddy run` command or use the caddy-api.service file instead.
|
|
# use sed to get caddy directory at install
|
|
|
|
[Unit]
|
|
Description=Caddy
|
|
Documentation=https://caddyserver.com/docs/
|
|
After=network.target
|
|
|
|
[Service]
|
|
# base directory must be hard coded
|
|
User=caddy
|
|
Group=caddy
|
|
WorkingDirectory=/opt/caddy
|
|
ExecStart=
|
|
|
|
ExecReload=/opt/caddy/scripts/caddy reload --config /opt/caddy/conf/%.conf --adapter=caddyfile
|
|
TimeoutStopSec=5s
|
|
LimitNOFILE=1048576
|
|
LimitNPROC=512
|
|
PrivateTmp=true
|
|
ProtectSystem=full
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|