File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 3
3
# This definition creates a virtual host
4
4
#
5
5
# Parameters:
6
- # [*server_name*] - Server name (value to match in Host: header). Defaults to the resource's name.
7
6
# [*ensure*] - Enables or disables the specified vhost (present|absent)
8
7
# [*listen_ip*] - Default IP Address for NGINX to listen with this vHost on. Defaults to all interfaces (*)
9
8
# [*listen_port*] - Default IP Port for NGINX to listen with this vHost on. Defaults to TCP 80
41
40
# ssl_key => '/tmp/server.pem',
42
41
# }
43
42
define nginx::resource::vhost (
44
- $server_name = $name,
45
43
$ensure = ' enable' ,
46
44
$listen_ip = ' *' ,
47
45
$listen_port = ' 80' ,
Original file line number Diff line number Diff line change 3
3
<%= key %> <%= value %> ;
4
4
<% end -%> <% end -%>
5
5
root <%= www_root %> ;
6
- index <% index_files.each do |i| %> <%= i %> <% end %> ;
7
-
8
6
<% if has_variable?("try_files") then %>
9
7
try_files <% try_files.each do |try| -%> <%= try %> <% end -%> ;
10
8
<% end %>
11
-
12
9
index <% index_files.each do |i| %> <%= i %> <% end %> ;
13
10
<% if @location_cfg_append -%> <% location_cfg_append.each do |key,value| -%>
14
11
<%= key %> <%= value %> ;
Original file line number Diff line number Diff line change 1
1
server {
2
2
listen <%= ssl_port %> ;
3
- <% if ipv6_enable == 'true' && (defined? ipaddress6) %> listen [<%= ipv6_listen_ip %> ]:<%= ipv6_listen_port %> default ipv6only=on;<% end %>
4
- server_name <%= server_name %> ;
3
+ <% if ipv6_enable == 'true' && (defined? ipaddress6) %>
4
+ listen [<%= ipv6_listen_ip %> ]:<%= ipv6_listen_port %> <% if @ipv6_listen_options %> <%= ipv6_listen_options %> <% end %> ipv6only=on;
5
+ <% end %>
6
+ server_name <%= rewrite_www_to_non_www ? name.gsub(/^www\./, '') : server_name.join(" ") %> ;
5
7
6
8
ssl on;
7
9
ssl_certificate <%= ssl_cert %> ;
You can’t perform that action at this time.
0 commit comments