Skip to content

Commit

Permalink
Moved root to vhost_header. One of common pitfalls is to define root …
Browse files Browse the repository at this point in the history
  • Loading branch information
Goran Miskovic committed Aug 7, 2013
1 parent 8997529 commit d22a259
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pkg/
.tmp/
pkg/
spec/fixtures/
.idea/
5 changes: 5 additions & 0 deletions templates/vhost/vhost_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ server {
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(" ") %>;

<% if defined? @www_root -%>
root <%= @www_root %>;
<% end -%>

<% if defined? auth_basic -%>
auth_basic "<%= @auth_basic %>";
<% end -%>
Expand Down
3 changes: 0 additions & 3 deletions templates/vhost/vhost_location_directory.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<% 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 %>;
<% end -%>
<% if @try_files -%>
try_files <% @try_files.each do |try| -%> <%= try %> <% end -%>;
<% end -%>
Expand Down
3 changes: 0 additions & 3 deletions templates/vhost/vhost_location_fastcgi.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<% 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 %>;
<% end -%>
<% if @fastcgi_split_path -%>
fastcgi_split_path_info <%= @fastcgi_split_path %>;
<% end -%>
Expand Down

0 comments on commit d22a259

Please sign in to comment.