From 0587839ebead40290c97aeb713e8b47148e146c4 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 6 Apr 2020 14:02:06 -0500 Subject: http api: T2160: Fix error message when api proxy restricted. --- data/templates/https/nginx.default.tmpl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'data/templates/https') diff --git a/data/templates/https/nginx.default.tmpl b/data/templates/https/nginx.default.tmpl index b6d3aaf83..33f7b2820 100644 --- a/data/templates/https/nginx.default.tmpl +++ b/data/templates/https/nginx.default.tmpl @@ -51,10 +51,17 @@ server { error_page 501 502 503 =200 @50*_json; +{% if api_somewhere %} + location @50*_json { + default_type application/json; + return 200 '{"error": "service https api unavailable at this proxy address: set service https api-restrict virtual-host"}'; + } +{% else %} location @50*_json { default_type application/json; return 200 '{"error": "Start service in configuration mode: set service https api"}'; } +{% endif %} } -- cgit v1.2.3