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: Allow HTTP access to internal endpoints from localhost.

Alex Vandiver02d3fb76660e
diff --git a/puppet/zulip/templates/nginx/zulip-enterprise.template.erb b/puppet/zulip/templates/nginx/zulip-enterprise.template.erb
index 143b5d38094..cf8e1ea334c 100644
--- a/puppet/zulip/templates/nginx/zulip-enterprise.template.erb
+++ b/puppet/zulip/templates/nginx/zulip-enterprise.template.erb
@@ -4,6 +4,19 @@ server {
listen 80;
listen [::]:80;
+ location /api/internal/ {
+ # If coming from localhost, we do allow access to internal
+ # APIs over HTTP, without an HTTPS redirect. Adding TLS does
+ # not 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;
+ }
+
location / {
return 301 https://$host$request_uri;
}