| 1 | # caddy.service |
| 2 | # |
| 3 | # For using Caddy with a config file. |
| 4 | # |
| 5 | # Make sure the ExecStart and ExecReload commands are correct |
| 6 | # for your installation. |
| 7 | # |
| 8 | # See https://caddyserver.com/docs/install for instructions. |
| 9 | # |
| 10 | # WARNING: This service does not use the --resume flag, so if you |
| 11 | # use the API to make changes, they will be overwritten by the |
| 12 | # Caddyfile next time the service is restarted. If you intend to |
| 13 | # use Caddy's API to configure it, add the --resume flag to the |
| 14 | # `caddy run` command or use the caddy-api.service file instead. |
| 15 | |
| 16 | [Unit] |
| 17 | Description=Caddy |
| 18 | Documentation=https://caddyserver.com/docs/ |
| 19 | After=network.target network-online.target |
| 20 | Requires=network-online.target |
| 21 | |
| 22 | [Service] |
| 23 | Type=notify |
| 24 | User=caddy |
| 25 | Group=caddy |
| 26 | ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile |
| 27 | ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force |
| 28 | TimeoutStopSec=5s |
| 29 | LimitNOFILE=1048576 |
| 30 | PrivateTmp=true |
| 31 | ProtectSystem=full |
| 32 | AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE |
| 33 | |
| 34 | [Install] |
| 35 | WantedBy=multi-user.target |