### Nginx Server Configuration Source: https://laravel.com/docs/13.x/deployment A starting point for Nginx server blocks. Ensure the root points to the public directory and all requests are directed to index.php. ```nginx server { listen 80; listen [::]:80; server_name example.com; root /srv/example.com/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; index index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ ^/index\.php(/|$) { fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; include fastcgi_params; fastcgi_buffer_size 32k; fastcgi_buffers 8 32k; fastcgi_busy_buffers_size 64k; fastcgi_hide_header X-Powered-By; } location ~ /\.(?!well-known).* { deny all; } } ``` -------------------------------- ### Optimize application performance Source: https://laravel.com/docs/13.x/deployment Caches configuration, events, routes, and views in a single command. ```shell php artisan optimize ``` -------------------------------- ### Cache configuration files Source: https://laravel.com/docs/13.x/deployment Combines all configuration files into a single cached file. Ensure the env function is only used within configuration files. ```shell php artisan config:cache ``` -------------------------------- ### Cache event mappings Source: https://laravel.com/docs/13.x/deployment Caches auto-discovered event to listener mappings. ```shell php artisan event:cache ``` -------------------------------- ### Cache Blade views Source: https://laravel.com/docs/13.x/deployment Precompiles all Blade views to avoid on-demand compilation. ```shell php artisan view:cache ``` -------------------------------- ### Cache route registrations Source: https://laravel.com/docs/13.x/deployment Reduces route registrations into a single cached file to improve performance for large applications. ```shell php artisan route:cache ``` -------------------------------- ### FrankenPHP Server Command Source: https://laravel.com/docs/13.x/deployment Command to serve a Laravel application using the FrankenPHP application server. ```shell frankenphp php-server -r public/ ``` -------------------------------- ### Clear optimization cache Source: https://laravel.com/docs/13.x/deployment Removes all cache files generated by the optimize command and clears the default cache driver. ```shell php artisan optimize:clear ``` -------------------------------- ### Reloading Long-Running Services Source: https://laravel.com/docs/13.x/deployment Use this command to gracefully terminate and reload services like queue workers, Reverb, or Octane after a deployment. ```shell php artisan reload ``` -------------------------------- ### Configuring the Health Check Route Source: https://laravel.com/docs/13.x/deployment Modify the health check URI in the bootstrap/app.php file to customize the endpoint used by uptime monitors or load balancers. ```php ->withRouting( web: __DIR__.'/../routes/web.php', commands: __DIR__.'/../routes/console.php', health: '/up', // [tl! remove] health: '/status', // [tl! add] ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.