From ed7a6d5e4d2d90c03b2224d5d321452c5bd446d7 Mon Sep 17 00:00:00 2001 From: Casper Kvan Clausen Date: Fri, 31 Jul 2020 19:00:45 -0500 Subject: [PATCH] puppet: Support nginx_listen_port with http_only --- puppet/zulip/manifests/app_frontend.pp | 6 +++++- puppet/zulip/templates/nginx/zulip-enterprise.template.erb | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/puppet/zulip/manifests/app_frontend.pp b/puppet/zulip/manifests/app_frontend.pp index 386c834880..830a93b2ba 100644 --- a/puppet/zulip/manifests/app_frontend.pp +++ b/puppet/zulip/manifests/app_frontend.pp @@ -5,7 +5,11 @@ class zulip::app_frontend { include zulip::app_frontend_once $nginx_http_only = zulipconf('application_server', 'http_only', undef) - $nginx_listen_port = zulipconf('application_server', 'nginx_listen_port', 443) + if $nginx_http_only != '' { + $nginx_listen_port = zulipconf('application_server', 'nginx_listen_port', 80) + } else { + $nginx_listen_port = zulipconf('application_server', 'nginx_listen_port', 443) + } $no_serve_uploads = zulipconf('application_server', 'no_serve_uploads', undef) $ssl_dir = $::osfamily ? { 'debian' => '/etc/ssl', diff --git a/puppet/zulip/templates/nginx/zulip-enterprise.template.erb b/puppet/zulip/templates/nginx/zulip-enterprise.template.erb index 58815b1a28..2e23d2654b 100644 --- a/puppet/zulip/templates/nginx/zulip-enterprise.template.erb +++ b/puppet/zulip/templates/nginx/zulip-enterprise.template.erb @@ -16,8 +16,8 @@ include /etc/nginx/zulip-include/upstreams; server { <% if @nginx_http_only != '' -%> - listen 80; - listen [::]:80; + listen <%= @nginx_listen_port %>; + listen [::]:<%= @nginx_listen_port %>; <% else -%> listen <%= @nginx_listen_port %> http2; listen [::]:<%= @nginx_listen_port %> http2;