Run Caddy on Boot


10/11/21: This article does not explain every step well but may be useful so I’m posting it.

Add the following to the root crontab: screen -d -m bash /home/josh/caddystart

Create a bash script that launches Caddy with your Caddyfile.

Create a Caddyfile in same directory you put your script in:


blog.joshmudge.com tls myemail@email.com root * /var/www/wordpress php_fastcgi unix//run/php/php7.4-fpm.sock #php_fastcgi localhost:9000 #log { #output file /home/josh/log.txt #} #php_fastcgi 127.0.0.1:9000 # Prevent malicious PHP uploads from running @uploads { path_regexp path /uploads\/(.*)\.php } rewrite @uploads / @wp-admin { path not ^\/wp-admin/* } rewrite @wp-admin {path}/index.php?{query} file_server

I did have to install php-fpm and configure wordpress.


Leave a Reply