Skip to content

Commit

Permalink
Merge pull request voxpupuli#834 from FlorianSW/master
Browse files Browse the repository at this point in the history
Allow locations with try_files only
  • Loading branch information
jyaworski authored Sep 11, 2016
2 parents 28c16c1 + d628e26 commit 9cc4ae6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifests/resource/location.pp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
if ($vhost == undef) {
fail('Cannot create a location reference without attaching to a virtual host')
}
if (($www_root == undef) and ($proxy == undef) and ($location_alias == undef) and ($stub_status == undef) and ($fastcgi == undef) and ($uwsgi == undef) and ($location_custom_cfg == undef) and ($internal == false)) {
if (($www_root == undef) and ($proxy == undef) and ($location_alias == undef) and ($stub_status == undef) and ($fastcgi == undef) and ($uwsgi == undef) and ($location_custom_cfg == undef) and ($internal == false) and ($try_files == undef)) {
fail('Cannot create a location reference without a www_root, proxy, location_alias, fastcgi, uwsgi, stub_status, internal, or location_custom_cfg defined')
}
if (($www_root != undef) and ($proxy != undef)) {
Expand Down Expand Up @@ -375,6 +375,8 @@
$content_real = template('nginx/vhost/locations/uwsgi.erb')
} elsif ($www_root != undef) {
$content_real = template('nginx/vhost/locations/directory.erb')
} elsif ($try_files != undef) {
$content_real = template('nginx/vhost/locations/try_files.erb')
} else {
$content_real = template('nginx/vhost/locations/empty.erb')
}
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/locations/try_files.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% if @try_files -%>
try_files<% @try_files.each do |try| -%> <%= try %><% end -%>;
<% end -%>

0 comments on commit 9cc4ae6

Please sign in to comment.