cookbook 'nginx-fastcgi', '~> 0.0.11', :supermarket
nginx-fastcgi (9) Versions 0.0.11 Follow4
create nginx site to run your fastcgi application under nginx frontend
cookbook 'nginx-fastcgi', '~> 0.0.11'
knife supermarket install nginx-fastcgi
knife supermarket download nginx-fastcgi
Description
Creates nginx site to run your fastcgi application with nginx front-end
Requirements
Should work on any platform where nginx is installed. Tested on Ubuntu/Debian.
Limitations
fastcgi standalone server mode is only supported
DEFINITIONS
nginx_fastcgi
This definition can be used to create nginx site to run your fastcgi application with nginx front-end.
The definition takes the following parameters:
-
name
: specifies a path for nginx site configuration file. No default, this must be specified. -
socket
: specifies unix socket of FastCGI server. -
inet_socket
: specifies inet socket of FastCGI server. No default. Choose either unix or inet socket.
Check out http://wiki.nginx.org/HttpFastcgiModule#fastcgi_pass for details.
-
static
: specifies location of static files (to be handled by nginx). Array of Hashes or hash with following keys:location
root
-
servers
: specifies virtual hosts to be included into ngix site configuration. Array of Hashes with following keys:ip
server_name
ssl
ssl_include_path
error_page
redirect
-
cookbook
: specifies the cookbook with nginx site configuration template. Optional -
fastcgi_param
: specifies additional fastcgi params -
error_page
- specifies custom error pages. Array of Hashes with following keys:- code
- handler
Check out http://wiki.nginx.org/HttpCoreModule#error_page for details
-
fastcgi_intercept_errors
- specify value for fastcgi_intercept_errors. Check out http://wiki.nginx.org/HttpFastcgiModule#fastcgi_intercept_errors for details. Default value is false -
fastcgi_read_timeout
- specify value for fastcgi read timeout. Check out http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_read_timeout for details. Default value is nil.
Usage cases
named virtual host, port 80
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
socket '/tmp/application.socket'
servers [
{
:ip => '127.0.0.1',
:server_name => 'foo.site.x'
}
]
end
fastcgi running on inet socket
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
inet_socket 'localhost:9000'
servers [
{
:ip => '127.0.0.1',
:server_name => 'foo.site.x'
}
]
end
ssl enabled virtual host
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
socket '/tmp/application.socket'
servers [
{
:server_name => 'bar.site.x',
:ssl => true,
:ssl_include_path => 'nginx_ssl_settings.conf'
}
]
end
set document root
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
root '/var/www/MyApp/root'
socket '/tmp/application.socket'
servers [
{
:server_name => 'foo.site.x',
}
]
end
enabling http -> https redirect
# all http traffic get redirected to https host:
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
socket '/tmp/application.socket'
servers [
{
:ip => '127.0.0.1',
:server_name => 'bar.site.x',
:redirect => 'https'
},
{
:ip => '127.0.0.1',
:server_name => 'bar.site.x',
:ssl => true,
:ssl_include_path => 'nginx_ssl_settings.conf'
}
]
end
handling static files by nginx
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
socket '/tmp/application.socket'
static(
:location => 'static/',
:root => '/var/www/MyApp/root'
)
servers [
{
:server_name => 'foo.site.x',
}
]
end
set specific fastcgi params:
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
socket '/tmp/application.socket'
fastcgi_param [
{ :name => 'SCRIPT_NAME', :value => "\"\"" },
{ :name => 'PATH_INFO' , :value => '$uri' }
]
servers [
{
:server_name => 'foo.site.x',
}
]
end
set error page, code 500
nginx_fastcgi '/etc/nginx/sites-available/foo.site.conf' do
socket '/tmp/application.socket'
servers [
{
:server_name => 'foo.site.x'
}
]
error_page [
{
:code => 500,
:handler => '/500.html'
}
]
end
For complete examples of usage see https://github.com/melezhik/cookbooks/tree/master/nginx-fastcgi/features
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.0.11 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.0.11 failed this metric
FC064: Ensure issues_url is set in metadata: nginx-fastcgi/metadata.rb:1
FC065: Ensure source_url is set in metadata: nginx-fastcgi/metadata.rb:1
FC066: Ensure chef_version is set in metadata: nginx-fastcgi/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.0.11 passed this metric
Publish Metric
0.0.11 passed this metric
Supported Platforms Metric
0.0.11 passed this metric
Testing File Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.0.11 failed this metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.0.11 failed this metric
FC064: Ensure issues_url is set in metadata: nginx-fastcgi/metadata.rb:1
FC065: Ensure source_url is set in metadata: nginx-fastcgi/metadata.rb:1
FC066: Ensure chef_version is set in metadata: nginx-fastcgi/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.0.11 passed this metric
Publish Metric
0.0.11 passed this metric
Supported Platforms Metric
0.0.11 passed this metric
Testing File Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.0.11 failed this metric
FC065: Ensure source_url is set in metadata: nginx-fastcgi/metadata.rb:1
FC066: Ensure chef_version is set in metadata: nginx-fastcgi/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.0.11 passed this metric
Publish Metric
0.0.11 passed this metric
Supported Platforms Metric
0.0.11 passed this metric
Testing File Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.0.11 passed this metric
0.0.11 passed this metric
Testing File Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.0.11 failed this metric
0.0.11 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number