Skip to content

Instantly share code, notes, and snippets.

@vnglst
Last active February 1, 2024 05:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnglst/354ca3208b6dfdfbae81 to your computer and use it in GitHub Desktop.
Save vnglst/354ca3208b6dfdfbae81 to your computer and use it in GitHub Desktop.
Caddy configuration files
# Upstart service for Caddy
# Save in /etc/init/caddy.conf
description "Caddy Server"
author "Koen van Gilst"
start on filesystem or runlevel [2345]
stop on shutdown
#not working yet, try again on 25/2
#setuid caddy
#setgid caddy
# Respawn in case of a crash, with default parameters
respawn
respawn limit 10 5
limit nofile 4096 4096
script
cd /opt/
exec /usr/local/bin/caddy
end script
pre-start script
echo "[`date`] Caddy Server Starting" >> /home/caddy/log/caddy-upstart.log
echo "Caddy Server started at `date +"%F %T.%N"`" | mail -s "Caddy Server Started" xxx@xxx.de
end script
terms.vangilst.eu {
proxy / localhost:2016
log /home/caddy/log/caddy-termworld.log {
rotate {
size 100 # Rotate after 100 MB
age 14 # Keep log files for 14 days
keep 10 # Keep at most 10 log files
}
}
}
converter.vangilst.de {
root /opt/converter
gzip
log /home/caddy/log/caddy-converter.log {
rotate {
size 100 # Rotate after 100 MB
age 14 # Keep log files for 14 days
keep 10 # Keep at most 10 log files
}
}
}
www.teamnl.de, teamnl.de {
root /opt/teamNL/www
gzip
## Feature currently not working
## Keeps restarting
## Using scp to update www folder
#git https://github.com/vnglst/teamnl.git ../ {
# hook /webhook koenmarion
# then npm run build
#}
log /home/caddy/log/caddy-teamnl.log {
rotate {
size 100 # Rotate after 100 MB
age 14 # Keep log files for 14 days
keep 10 # Keep at most 10 log files
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment