Code excerpts from video.
Default path:
Bash:
> sudo nano /etc/caddy/CaddyFile
Redirect with HTTP:
Bash:
tutorial.itbible.org:80 {
redir https://google.com permanent
}
Redirect with HTTPS:
Bash:
tutorial.itbible.org:443 {
redir https://google.com permanent
}
Reverse Proxy (Forces HTTPS with HTTP redirect to HTTPS):
Bash:
tutorial.itbible.org {
reverse_proxy https://localhost:81
}
Basic HTML Web Page:
Bash:
tutorial.itbible.org {
root * /var/www/basic/
file_server
}
Dynamic PHP Web Page (with PHP8.1-FPM):
Bash:
tutorial.itbible.org {
root * /var/www/php/
file_server
php_fastcgi unix//var/run/php/php8.1-fpm.sock
try_files {path} /index.php?{query}
}