module-nginx/templates/vhost/vhost_header.erb
Lebedev Vadim 8d33fd63f1 Merge branch 'master' of https://github.com/jfryman/puppet-nginx
Conflicts:
	manifests/config.pp
	manifests/init.pp
	manifests/params.pp
	manifests/resource/location.pp
	manifests/resource/vhost.pp
	manifests/service.pp
	templates/vhost/vhost_footer.erb
	templates/vhost/vhost_header.erb
	templates/vhost/vhost_location_directory.erb
	templates/vhost/vhost_location_proxy.erb
	templates/vhost/vhost_ssl_header.erb
	tests/vhost.pp
2013-05-21 16:30:21 +04:00

22 lines
1,014 B
Text

server {
listen <%= listen_ip %>:<%= listen_port %> <% if @listen_options %><%= listen_options %><% end %>;
<% # check to see if ipv6 support exists in the kernel before applying %>
<% if ipv6_enable == 'true' && (defined? ipaddress6) %>
listen [<%= ipv6_listen_ip %>]:<%= ipv6_listen_port %> <% if @ipv6_listen_options %><%= ipv6_listen_options %><% end %> ipv6only=on;
<% end %>
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 -%>
auth_basic "<%= auth_basic %>";
<% end -%>
<% if defined? auth_basic_user_file -%>
auth_basic_user_file <%= auth_basic_user_file %>;
<% end -%>
<% proxy_set_header.each do |header| %>
proxy_set_header <%= header %>;<% end %>
<% if @rewrite_to_https %>
if ($ssl_protocol = "") {
return 301 https://$host$request_uri ;
}
<% end %>