Skip to content

Instantly share code, notes, and snippets.

@arifnd
Last active August 17, 2022 18:36
Show Gist options
  • Select an option

  • Save arifnd/6085be06dd0f884e97d51fea7d95a3b5 to your computer and use it in GitHub Desktop.

Select an option

Save arifnd/6085be06dd0f884e97d51fea7d95a3b5 to your computer and use it in GitHub Desktop.
Caddy laravel config
import snippets/*
:80 {
}
import laravel-app domain.com /home/user/laravel/folder
# snippets/laravel-app
# {args.0} represents the root url of the app. Example: "domain.com".
# {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 zstd gzip
# Enable PHP-FPM
php_fastcgi unix//run/php/php7.4-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