Created
May 11, 2022 00:07
-
-
Save abdumu/64a879450fc500a006eee3ef61b76c68 to your computer and use it in GitHub Desktop.
Laravel caddy2, multiple websites on ubuntu custom domains : in /etc/caddy, and in /etc/caddy/snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
debug | |
} | |
import snippets/* | |
#website 1 | |
import laravel-app website.localhost /home/name/www/website | |
import laravel-app *.website.localhost /home/name/www/website | |
#website 2 .. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# snippets/laravel-app | |
# {args.0} represents the root url of the app. Example: "jorgeglz.io". | |
# {args.1} represents the root path to the app. Example: "/var/www/my-site.com" | |
(laravel-app) { | |
{args.0} { | |
# Resolve the root directory for the app | |
root * {args.1}/public | |
# Provide zstd and Gzip compression | |
encode gzip | |
# Enable PHP-FPM | |
php_fastcgi unix//run/php/php8.1-fpm.sock | |
# Allow caddy to serve static files | |
file_server | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment