streamhost.erb 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. server {
  2. <%- if @listen_ip.is_a?(Array) then -%>
  3. <%- @listen_ip.each do |ip| -%>
  4. listen <%= ip %>:<%= @listen_port %><% if @listen_options %> <%= @listen_options %><% end %>;
  5. <%- end -%>
  6. <%- else -%>
  7. listen <%= @listen_ip %>:<%= @listen_port %><% if @listen_options %> <%= @listen_options %><% end %>;
  8. <%- end -%>
  9. <%# check to see if ipv6 support exists in the kernel before applying -%>
  10. <%- if @ipv6_enable && (defined? @ipaddress6) -%>
  11. <%- if @ipv6_listen_ip.is_a?(Array) then -%>
  12. <%- @ipv6_listen_ip.each do |ipv6| -%>
  13. listen [<%= ipv6 %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>;
  14. <%- end -%>
  15. <%- else -%>
  16. listen [<%= @ipv6_listen_ip %>]:<%= @ipv6_listen_port %> <% if @ipv6_listen_options %><%= @ipv6_listen_options %><% end %>;
  17. <%- end -%>
  18. <%- end -%>
  19. server_name <%= @server_name.join(" ") %>;
  20. <% Array(@raw_prepend).each do |line| -%>
  21. <%= line %>
  22. <% end %>
  23. proxy_timeout <%= @proxy_read_timeout %>;
  24. proxy_connect_timeout <%= @proxy_connect_timeout %>;
  25. proxy_pass <%= @proxy %>;
  26. <% Array(@raw_append).each do |line| -%>
  27. <%= line %>
  28. <% end -%>
  29. }