Dmitri10 / chef-laravel-nginx

Chef cookbook to create Nginx sites for Laravel applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel-nginx Chef Cookbook

Chef cookbook that provides a LWRP for Laravel Nginx sites with PHP-FPM. Provides a base Nginx config for common Laravel settings at /etc/nginx/laravel.conf.

Based on wordpress-nginx by Scott Walkinshaw

Requirements

Attributes

  • node['laravel_nginx']['fastcgi_read_timeout'] - Timeout for reading a response from the FastCGI server (default=3600s)
  • node['laravel_nginx']['static_file_expiry'] - Expiry time for static assets js|css|png|jpg|jpeg|gif|ico (default=24h)
  • node['laravel_nginx']['php_fpm']['listen'] - Listen socket for PHP-FPM (default=/var/run/php-fpm-www.sock)

Usage

Basic usage with only host and document root:

laravel_nginx_site 'example.com' do
  host 'example.com'
  root '/srv/www/example.com'
end

This resource would create an Nginx site at /etc/nginx/sites-available/example.com and enable it.

If you need to add additional custom config options, you can use the code attribute:

laravel_nginx_site 'example.com' do
  host 'example.com'
  root '/srv/www/example.com'
  code "include #{node['nginx']['dir']}/custom.conf;"
  notifies :reload, 'service[nginx]'
end

License and Authors

See LICENSE

About

Chef cookbook to create Nginx sites for Laravel applications

License:MIT License


Languages

Language:HTML 64.3%Language:Ruby 35.7%