vhost_header.erb 822 B

12345678910111213141516
  1. server {
  2. listen <%= listen_ip %>:<%= listen_port %> <% if @listen_options %><%= listen_options %><% end %>;
  3. <% # check to see if ipv6 support exists in the kernel before applying %>
  4. <% if ipv6_enable == 'true' && (defined? ipaddress6) %>
  5. listen [<%= ipv6_listen_ip %>]:<%= ipv6_listen_port %> <% if @ipv6_listen_options %><%= ipv6_listen_options %><% end %> ipv6only=on;
  6. <% end %>
  7. server_name <%= rewrite_www_to_non_www ? name.gsub(/^www\./, '') : server_name.join(" ") %>;
  8. access_log <%= scope.lookupvar('nginx::params::nx_logdir')%>/<%= name %>.access.log;
  9. <% proxy_set_header.each do |header| %>
  10. proxy_set_header <%= header %>;<% end %>
  11. <% if @rewrite_to_https %>
  12. if ($ssl_protocol = "") {
  13. return 301 https://$host$request_uri ;
  14. }
  15. <% end %>