Skip to content

Instantly share code, notes, and snippets.

@jeroneemou
Created April 4, 2018 12:50
Show Gist options
  • Save jeroneemou/e7132fa6aee6dde6645acae1798e84a3 to your computer and use it in GitHub Desktop.
Save jeroneemou/e7132fa6aee6dde6645acae1798e84a3 to your computer and use it in GitHub Desktop.
/etc/systemd/system/caddy.service
[Unit]
Description=Caddy HTTP/2 web server
Documentation=https://caddyserver.com/docs
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Restart=on-failure
User=www-data
Group=www-data
Environment=HOME=/etc/ssl/caddy
ExecStart=/usr/local/bin/caddy -log stdout -agree=true -conf=/etc/caddy/Caddyfile -root=/var/tmp
ExecReload=/bin/kill -USR1 $MAINPID
LimitNOFILE=4096
LimitNPROC=64
PrivateTmp=true
PrivateDevices=true
ProtectHome=true
ProtectSystem=full
ReadWriteDirectories=/etc/ssl/caddy
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment