From 69de1e372c4ba662799542ca1d9416bae4739ca2 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Fri, 26 Mar 2021 21:32:36 +0100 Subject: [PATCH] Make the expert-app trigger the same 404 as the webservice. --- app-config/nginx/nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app-config/nginx/nginx.conf b/app-config/nginx/nginx.conf index 0895e583..8104caa3 100644 --- a/app-config/nginx/nginx.conf +++ b/app-config/nginx/nginx.conf @@ -66,10 +66,20 @@ http { return 302 /auth/login; } + location @proxy_404_error_handler { + # Pass the request on to the webservice. Most likely the URI won't + # exist so we get a 404 from that service instead (good as the 404 + # pages are consistent). + proxy_pass http://cara-webservice:8080/$request_uri; + } + location /voila-server/ { + proxy_intercept_errors on; + # Anything under voila-server or expert-app is authenticated. auth_request /auth/probe; error_page 401 = @error401; + error_page 404 = @proxy_404_error_handler; # cara-app is the name of the voila server in each of docker-compose, # test-cara.web.cern.ch and cara.web.cern.ch.