Migrate RS Discourse proxy to openresty

This commit is contained in:
Râu Cao
2023-07-26 15:57:08 +02:00
parent 15b2ea284a
commit 1362da0add
6 changed files with 37 additions and 12 deletions

View File

@@ -1,14 +1,13 @@
# Generated by Chef
upstream _discourse {
upstream _rs_discourse {
<% @upstream_ip_addresses.each do |upstream_ip_address| -%>
server <%= upstream_ip_address %>:<%= @upstream_port %>;
<% end -%>
}
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
server {
server_name <%= @server_name %>;
listen 443 ssl http2;
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate <%= @ssl_cert %>;
@@ -28,8 +27,7 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://_discourse;
proxy_pass http://_rs_discourse;
proxy_http_version 1.1;
}
}
<% end -%>