Custom Domains for Statamic on Laravel Forge
You can't just add a domain to Forge, there are a few other steps.
Welcome to my new site powered by Statamic on Laravel Forge.
The final step in getting this launched was to set up the proper custom domain. To do that go to your Domains tab and set the domain. Run the script to install an SSL then make the domain primary.
With all that done I was still seeing a 500 error on my domain. So next head to Settings and your .env file. Change the APP_URL=<yoursite> to the domain for your site.
You're almost done.
Clear Your Cache
With your domain setup it's time to clear your cache. You could ssh into your site and run php artisan optimize:clear to get the domain running but you should also make sure that any caches are cleared whenever you deploy.
The default deploy script is below with my additions.
cd /home/forge/sfndesign.ca
git pull origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
# Prevent concurrent php-fpm reloads...
touch /tmp/fpmlock 2>/dev/null || true
( flock -w 10 9 || exit 1
echo 'Reloading PHP FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9</tmp/fpmlock
npm ci && npm run build
if [ -f artisan ]; then
$FORGE_PHP artisan optimize
$FORGE_PHP please stache:warm
$FORGE_PHP please search:update --all
# $FORGE_PHP please static:clear
# $FORGE_PHP please static:warm --queue
# my additions
$FORGE_PHP artisan optimize:clear
$FORGE_PHP artisan config:clear
$FORGE_PHP artisan cache:clear
$FORGE_PHP artisan view:clear
$FORGE_PHP please stache:warm
fi