Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

nginx: Move localhost to its own block, bound to the loopback address.

Alex Vandiverb4fb22ba1bef
diff --git a/puppet/zulip/templates/nginx/zulip-enterprise.template.erb b/puppet/zulip/templates/nginx/zulip-enterprise.template.erb
index 6cf3fdcd4d7..91c098380ff 100644
--- a/puppet/zulip/templates/nginx/zulip-enterprise.template.erb
+++ b/puppet/zulip/templates/nginx/zulip-enterprise.template.erb
@@ -1,28 +1,29 @@
+# For local IPC -- tusd to Django, or Django to Tornado
+server {
<% if @nginx_http_only -%>
+ listen 127.0.0.1:<%= @nginx_listen_port %>;
<% else -%>
-server {
- listen 80;
- listen [::]:80;
-
+ listen 127.0.0.1:80;
+<% end -%>
location /api/internal/ {
- # If coming from localhost, we do allow access to internal
- # APIs over HTTP, without an HTTPS redirect. Adding TLS does
- # not add appreciable security to connections from localhost,
- # and the certificate will never validate.
- allow 127.0.0.1;
- allow ::1;
- deny all;
-
include /etc/nginx/zulip-include/api_headers;
include uwsgi_params;
}
+ include /etc/nginx/zulip-include/localhost.d/*.conf;
+}
+
+
+<% if @nginx_http_only -%>
+<% else -%>
+server {
+ listen 80;
+ listen [::]:80;
location / {
return 301 https://$host$request_uri;
}
include /etc/nginx/zulip-include/certbot;
- include /etc/nginx/zulip-include/localhost.d/*.conf;
}
<% end -%>