Extract the nginx config for discourse to a recipe

Get the upstream servers automatically from Chef nodes
This commit is contained in:
Greg Karékinian
2022-02-18 18:14:33 +01:00
parent 7a8fb1bc78
commit e8f46db49c
3 changed files with 35 additions and 41 deletions

View File

@@ -1,6 +1,8 @@
# Generated by Chef
upstream _discourse {
server localhost:<%= @upstream_port %>;
<% @upstream_ip_addresses.each do |upstream_ip_address| -%>
server <%= upstream_ip_address %>:<%= @upstream_port %>;
<% end -%>
}
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>