Skip to content

Chef cookbook to create Nginx sites for Laravel applications

License

Notifications You must be signed in to change notification settings

MiniCodeMonkey/chef-laravel-nginx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%