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.

tornado: Move internal tornado redirect to under /internal/.

Alex Vandiverb20ecabf8f60
diff --git a/puppet/zulip/files/nginx/zulip-include-frontend/app b/puppet/zulip/files/nginx/zulip-include-frontend/app
index 4b7e76e13e7..e7ff52ad0fb 100644
--- a/puppet/zulip/files/nginx/zulip-include-frontend/app
+++ b/puppet/zulip/files/nginx/zulip-include-frontend/app
@@ -43,7 +43,7 @@ location /api/v1/events {
}
# Handle X-Accel-Redirect from Tornado to Tornado
-location ~ ^/tornado/(\d+)(/.*)$ {
+location ~ ^/internal/tornado/(\d+)(/.*)$ {
internal;
proxy_pass http://tornado$1$2$is_args$args;
include /etc/nginx/zulip-include/proxy_longpolling;
diff --git a/zerver/tornado/views.py b/zerver/tornado/views.py
index 3f511bde20e..2d96b3aa2f7 100644
--- a/zerver/tornado/views.py
+++ b/zerver/tornado/views.py
@@ -98,7 +98,8 @@ def get_events(request: HttpRequest, user_profile: UserProfile) -> HttpResponse:
# which is efficient and keeps this redirect invisible to
# clients.
return HttpResponse(
- "", headers={"X-Accel-Redirect": f"/tornado/{user_port}{request.get_full_path()}"}
+ "",
+ headers={"X-Accel-Redirect": f"/internal/tornado/{user_port}{request.get_full_path()}"},
)
return get_events_backend(request, user_profile)