This directory contains configuration file templates for various components of the Laravel Server Setup Script.
nginx-laravel.conf.template- Basic HTTP virtual hostnginx-laravel-ssl.conf.template- HTTPS with Let's Encrypt SSL
Variables:
{{DOMAIN_NAME}}- Server domain name{{LARAVEL_PATH}}- Full path to Laravel project{{APP_NAME}}- Application name for logs{{PHP_VERSION}}- PHP version (e.g., 8.3)
apache-laravel.conf.template- Basic HTTP virtual hostapache-laravel-ssl.conf.template- HTTPS with Let's Encrypt SSL
Variables:
{{DOMAIN_NAME}}- Server domain name{{LARAVEL_PATH}}- Full path to Laravel project{{APP_NAME}}- Application name for logs{{PHP_VERSION}}- PHP version (e.g., 8.3)
caddy-laravel.conf.template- Caddyfile configuration (auto-HTTPS)
Variables:
{{DOMAIN_NAME}}- Server domain name{{LARAVEL_PATH}}- Full path to Laravel project{{APP_NAME}}- Application name for logs{{PHP_VERSION}}- PHP version (e.g., 8.3)
supervisor-queue.conf.template- Laravel queue worker configurationsupervisor-horizon.conf.template- Laravel Horizon configuration
Variables:
{{APP_NAME}}- Application name{{QUEUE_NAME}}- Queue name (default, high, low, etc.){{LARAVEL_PATH}}- Full path to Laravel project{{QUEUE_DRIVER}}- Queue driver (database, redis, sync){{WEB_USER}}- Web server user (www-data){{NUM_PROCS}}- Number of worker processes
# Example: Generate Nginx configuration
sed -e "s|{{DOMAIN_NAME}}|example.com|g" \
-e "s|{{LARAVEL_PATH}}|/var/www/html/myapp|g" \
-e "s|{{APP_NAME}}|myapp|g" \
-e "s|{{PHP_VERSION}}|8.3|g" \
nginx-laravel.conf.template > /etc/nginx/sites-available/myapp.conf# Set environment variables
export DOMAIN_NAME="example.com"
export LARAVEL_PATH="/var/www/html/myapp"
export APP_NAME="myapp"
export PHP_VERSION="8.3"
# Generate configuration
envsubst < nginx-laravel.conf.template > /etc/nginx/sites-available/myapp.conf#!/bin/bash
generate_config() {
local template_file="$1"
local output_file="$2"
cp "$template_file" "$output_file"
sed -i "s|{{DOMAIN_NAME}}|$DOMAIN_NAME|g" "$output_file"
sed -i "s|{{LARAVEL_PATH}}|$LARAVEL_PATH|g" "$output_file"
sed -i "s|{{APP_NAME}}|$APP_NAME|g" "$output_file"
sed -i "s|{{PHP_VERSION}}|$PHP_VERSION|g" "$output_file"
}
# Usage
generate_config "nginx-laravel.conf.template" "/etc/nginx/sites-available/myapp.conf"-
Use Clear Variable Names
- Use
{{VARIABLE_NAME}}format for placeholders - Make variable names descriptive and uppercase
- Document all variables in this README
- Use
-
Follow Best Practices
- Security hardening enabled by default
- Performance optimization included
- Proper logging configuration
- Error handling
-
Include Comments
- Explain complex configurations
- Document why specific settings are used
- Provide examples for customization
-
Test Thoroughly
- Test on multiple OS distributions
- Verify all variables are replaced
- Check syntax before using
- Test with real Laravel applications
All templates include:
- ✅ Security headers (X-Frame-Options, X-Content-Type-Options, etc.)
- ✅ Hidden file protection (.env, .git, etc.)
- ✅ Sensitive file protection (composer.json, package.json, etc.)
- ✅ Server signature hiding
- ✅ Modern TLS configuration (TLS 1.2+)
- ✅ Strong cipher suites
- ✅ OCSP stapling (SSL templates)
- ✅ HSTS header (SSL templates)
Edit generated config and change:
client_max_body_size 100M; # Change to desired sizeAdd to generated config:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
</IfModule>Add to supervisor config:
environment=KEY1="value1",KEY2="value2"- Nginx Documentation
- Apache Documentation
- Caddy Documentation
- Supervisor Documentation
- Laravel Deployment
If you find issues with templates:
- Check variable replacement is complete
- Verify file permissions (644 for configs)
- Test configuration syntax:
- Nginx:
nginx -t - Apache:
apachectl configtest - Caddy:
caddy validate
- Nginx:
- Check service logs for errors
- v3.0 - Initial template collection
- Nginx HTTP/HTTPS templates
- Apache HTTP/HTTPS templates
- Caddy template with auto-HTTPS
- Supervisor queue worker templates
- Laravel Horizon template
Maintained by: FIGLAB
Last Updated: January 2026