Merge pull request #103 from abraham1901/dev
Some changes have been made
This commit is contained in:
commit
b384339fa2
11 changed files with 66 additions and 5 deletions
|
@ -131,6 +131,14 @@ define nginx::resource::location (
|
||||||
$content_real = template('nginx/vhost/vhost_location_empty.erb')
|
$content_real = template('nginx/vhost/vhost_location_empty.erb')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $fastcgi != undef and !defined(File['/etc/nginx/fastcgi_params']) {
|
||||||
|
file { '/etc/nginx/fastcgi_params':
|
||||||
|
ensure => present,
|
||||||
|
mode => '0770',
|
||||||
|
content => template('nginx/vhost/fastcgi_params.erb'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
## Create stubs for vHost File Fragment Pattern
|
## Create stubs for vHost File Fragment Pattern
|
||||||
if ($ssl_only != true) {
|
if ($ssl_only != true) {
|
||||||
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${priority}-${name}":
|
file {"${nginx::config::nx_temp_dir}/nginx.d/${vhost}-${priority}-${name}":
|
||||||
|
|
|
@ -174,6 +174,14 @@ define nginx::resource::vhost (
|
||||||
location_cfg_append => $location_cfg_append }
|
location_cfg_append => $location_cfg_append }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $fastcgi != undef and !defined(File['/etc/nginx/fastcgi_params']) {
|
||||||
|
file { '/etc/nginx/fastcgi_params':
|
||||||
|
ensure => present,
|
||||||
|
mode => '0770',
|
||||||
|
content => template('nginx/vhost/fastcgi_params.erb'),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Create a proper file close stub.
|
# Create a proper file close stub.
|
||||||
if ($listen_port != $ssl_port) {
|
if ($listen_port != $ssl_port) {
|
||||||
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-699": content => template('nginx/vhost/vhost_footer.erb'), }
|
file { "${nginx::config::nx_temp_dir}/nginx.d/${name}-699": content => template('nginx/vhost/vhost_footer.erb'), }
|
||||||
|
|
27
templates/vhost/fastcgi_params.erb
Normal file
27
templates/vhost/fastcgi_params.erb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# This file managed by puppet on host <%= @fqdn %>
|
||||||
|
|
||||||
|
fastcgi_param QUERY_STRING $query_string;
|
||||||
|
fastcgi_param REQUEST_METHOD $request_method;
|
||||||
|
fastcgi_param CONTENT_TYPE $content_type;
|
||||||
|
fastcgi_param CONTENT_LENGTH $content_length;
|
||||||
|
|
||||||
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
|
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||||
|
fastcgi_param REQUEST_URI $request_uri;
|
||||||
|
fastcgi_param DOCUMENT_URI $document_uri;
|
||||||
|
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||||
|
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||||
|
|
||||||
|
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||||
|
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||||
|
|
||||||
|
fastcgi_param REMOTE_ADDR $remote_addr;
|
||||||
|
fastcgi_param REMOTE_PORT $remote_port;
|
||||||
|
fastcgi_param SERVER_ADDR $server_addr;
|
||||||
|
fastcgi_param SERVER_PORT $server_port;
|
||||||
|
fastcgi_param SERVER_NAME $server_name;
|
||||||
|
|
||||||
|
fastcgi_param HTTPS $https;
|
||||||
|
|
||||||
|
# PHP only, required if PHP was built with --enable-force-cgi-redirect
|
||||||
|
fastcgi_param REDIRECT_STATUS 200;
|
|
@ -5,14 +5,12 @@ server {
|
||||||
listen [<%= ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %> ipv6only=on;
|
listen [<%= ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %> ipv6only=on;
|
||||||
<% end %>
|
<% end %>
|
||||||
server_name <%= @rewrite_www_to_non_www ? @name.gsub(/^www\./, '') : @server_name.join(" ") %>;
|
server_name <%= @rewrite_www_to_non_www ? @name.gsub(/^www\./, '') : @server_name.join(" ") %>;
|
||||||
access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= @name %>.access.log;
|
|
||||||
<% if defined? auth_basic -%>
|
<% if defined? auth_basic -%>
|
||||||
auth_basic "<%= @auth_basic %>";
|
auth_basic "<%= @auth_basic %>";
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if defined? auth_basic_user_file -%>
|
<% if defined? auth_basic_user_file -%>
|
||||||
auth_basic_user_file <%= @auth_basic_user_file %>;
|
auth_basic_user_file <%= @auth_basic_user_file %>;
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<% @proxy_set_header.each do |header| -%>
|
<% @proxy_set_header.each do |header| -%>
|
||||||
proxy_set_header <%= header %>;
|
proxy_set_header <%= header %>;
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
@ -21,3 +19,7 @@ server {
|
||||||
return 301 https://$host$request_uri;
|
return 301 https://$host$request_uri;
|
||||||
}
|
}
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= @name.gsub(' ', '_') %>.access.log;
|
||||||
|
error_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= @name.gsub(' ', '_') %>.error.log;
|
||||||
|
|
||||||
|
|
|
@ -5,3 +5,4 @@
|
||||||
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
|
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
|
||||||
<%= key %> <%= value %>;<% end -%><% end -%>
|
<%= key %> <%= value %>;<% end -%><% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
|
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
|
||||||
<%= key %> <%= value %>;
|
<%= key %> <%= value %>;
|
||||||
<% end -%><% end -%>
|
<% end -%><% end -%>
|
||||||
|
<% if defined? @www_root -%>
|
||||||
root <%= @www_root %>;
|
root <%= @www_root %>;
|
||||||
|
<% end -%>
|
||||||
<% if @try_files -%>
|
<% if @try_files -%>
|
||||||
try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
|
try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
@ -19,3 +21,4 @@
|
||||||
<%= key %> <%= value %>;
|
<%= key %> <%= value %>;
|
||||||
<% end -%><% end -%>
|
<% end -%><% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
<%= key %> <%= value %>;
|
<%= key %> <%= value %>;
|
||||||
<% end -%><% end -%>
|
<% end -%><% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
location <%= @location %> {
|
location <%= @location %> {
|
||||||
|
<% if @location_cfg_prepend -%><% @location_cfg_prepend.sort_by {|k,v| k}.each do |key,value| -%>
|
||||||
|
<%= key %> <%= value %>;
|
||||||
|
<% end -%><% end -%>
|
||||||
|
<% if defined? @www_root -%>
|
||||||
root <%= @www_root %>;
|
root <%= @www_root %>;
|
||||||
|
<% end -%>
|
||||||
include <%= @fastcgi_params %>;
|
include <%= @fastcgi_params %>;
|
||||||
fastcgi_pass <%= @fastcgi %>;
|
fastcgi_pass <%= @fastcgi %>;
|
||||||
<% unless @fastcgi_script == :undef %>
|
<% if defined? @fastcgi_script %>
|
||||||
fastcgi_param SCRIPT_FILENAME <%= @fastcgi_script %>;
|
fastcgi_param SCRIPT_FILENAME <%= @fastcgi_script %>;
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
|
||||||
|
<%= key %> <%= value %>;
|
||||||
|
<% end -%><% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,3 +12,4 @@
|
||||||
<%= key %> <%= value %>;
|
<%= key %> <%= value %>;
|
||||||
<% end -%><% end -%>
|
<% end -%><% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,3 +5,4 @@
|
||||||
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
|
<% if @location_cfg_append -%><% @location_cfg_append.sort_by {|k,v| k}.each do |key,value| -%>
|
||||||
<%= key %> <%= value %>;<% end -%><% end -%>
|
<%= key %> <%= value %>;<% end -%><% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ server {
|
||||||
ssl_protocols <%= @ssl_protocols %>;
|
ssl_protocols <%= @ssl_protocols %>;
|
||||||
ssl_ciphers <%= @ssl_ciphers %>;
|
ssl_ciphers <%= @ssl_ciphers %>;
|
||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
<% if @auth_basic != :undef -%>
|
<% if defined? @auth_basic -%>
|
||||||
auth_basic "<%= @auth_basic %>";
|
auth_basic "<%= @auth_basic %>";
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% if @auth_basic_user_file != :undef -%>
|
<% if defined? @auth_basic_user_file -%>
|
||||||
auth_basic_user_file <%= @auth_basic_user_file %>;
|
auth_basic_user_file <%= @auth_basic_user_file %>;
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue