module-nginx/templates/vhost/locations/fastcgi.erb
Mathias Lafeldt cfdd74436e Sort fastcgi params to have stable ordering
The hash sorting was started in #532 and this fixes it for fastcgi as
well.
2015-02-05 11:48:58 +01:00

22 lines
864 B
Text

<% if defined? @www_root -%>
root <%= @www_root %>;
<% end -%>
include <%= @fastcgi_params %>;
<% if @try_files -%>
try_files <% @try_files.each do |try| -%> <%= try %><% end -%>;
<% end -%>
fastcgi_pass <%= @fastcgi %>;
<% if @fastcgi_split_path -%>
fastcgi_split_path_info <%= @fastcgi_split_path %>;
<% end -%>
<% if defined? @fastcgi_script -%>
<%-# this setting can be overridden by setting it in the fastcgi_param hash too %>
<%- @fastcgi_param = { 'SCRIPT_FILENAME' => @fastcgi_script }.merge(@fastcgi_param || {}) -%>
<% end -%>
<% if defined? @fastcgi_param -%>
<%- field_width = @fastcgi_param.inject(0) { |l,(k,v)| k.size > l ? k.size : l } -%>
<%- @fastcgi_param.sort_by {|k,v| k}.each do |key, val| -%>
fastcgi_param <%= sprintf("%-*s", field_width, key) %> <%= val %>;
<%- end -%>
<% end -%>