-
Notifications
You must be signed in to change notification settings - Fork 60
added parameters to enable fastcgi and creates www_root #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,13 +48,18 @@ | |
| $proxy_read_timeout = '90', | ||
| $index_files = ['index.html', 'index.htm', 'index.php'], | ||
| $template_header = 'nginx/vhost/vhost_header.erb', | ||
| $template_fastcgi = 'nginx/vhost/vhost_fastcgi.erb', | ||
| $template_footer = 'nginx/vhost/vhost_footer.erb', | ||
| $template_ssl_header = 'nginx/vhost/vhost_ssl_header.erb', | ||
| $template_ssl_footer = 'nginx/vhost/vhost_footer.erb', | ||
| $template_ssl_proxy = 'nginx/vhost/vhost_location_proxy.erb', | ||
| $template_proxy = 'nginx/vhost/vhost_location_proxy.erb', | ||
| $template_directory = 'nginx/vhost/vhost_location_directory.erb', | ||
| $www_root = undef | ||
| $www_root = undef, | ||
| $create_www_root = false, | ||
| $owner = '', | ||
| $groupowner = '', | ||
| $fastcgi = absent, | ||
| ) { | ||
|
|
||
| File { | ||
|
|
@@ -63,7 +68,21 @@ | |
| mode => '0644', | ||
| require => Package['nginx'] | ||
| } | ||
|
|
||
| include nginx | ||
| include nginx::params | ||
| include concat::setup | ||
|
|
||
| $real_owner = $owner ? { | ||
| '' => "${nginx::process_user}", | ||
| default => $owner, | ||
| } | ||
|
|
||
| $real_groupowner = $groupowner ? { | ||
| '' => "${nginx::process_user}", | ||
| default => $groupowner, | ||
| } | ||
|
|
||
| concat { "${nginx::config_dir}/sites-available/${name}.conf": | ||
| } | ||
|
|
||
|
|
@@ -108,12 +127,23 @@ | |
| proxy => $proxy, | ||
| proxy_read_timeout => $proxy_read_timeout, | ||
| www_root => $www_root, | ||
| create_www_root => $create_www_root, | ||
| owner => $real_owner, | ||
| groupowner => $real_groupowner, | ||
| notify => $nginx::manage_service_autorestart, | ||
| template_proxy => $template_proxy, | ||
| template_ssl_proxy => $template_ssl_proxy, | ||
| template_directory => $template_directory, | ||
| } | ||
|
|
||
| concat::fragment { "${name}+68-fastcgi.tmp": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is fastcgi a modules ALWAYS used in nginx?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will be included only in vhost that $fastcgi = present.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, waiting for the fix before merging, then.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default, $fastcgi = absent... this concat fragment won't be created to all vhosts.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, you are right sorry. |
||
| order => '68', | ||
| content => template("${template_fastcgi}"), | ||
| ensure => $fastcgi, | ||
| notify => $nginx::manage_service_autorestart, | ||
| target => "${nginx::config_dir}/sites-available/${name}.conf", | ||
| } | ||
|
|
||
| # Create a proper file close stub. | ||
| concat::fragment { "${name}+69.tmp": | ||
| order => '69', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| location ~ \.php$ { | ||
| try_files $uri =404; | ||
|
|
||
| fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
|
|
||
| fastcgi_pass unix:/var/run/php5-fpm-<%= @real_owner %>.sock; | ||
| fastcgi_index index.php; | ||
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
| fastcgi_param PATH_INFO $fastcgi_script_name; | ||
| include fastcgi_params; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be saner to set the owner and group to root as default?