diff --git a/app-config/nginx/nginx.conf b/app-config/nginx/nginx.conf index 2fef5b56..e59de300 100644 --- a/app-config/nginx/nginx.conf +++ b/app-config/nginx/nginx.conf @@ -93,6 +93,25 @@ http { absolute_redirect off; rewrite ^/voila/(.*)$ /voila-server/voila/$1 redirect; + location /CO2-voila-server/ { + proxy_intercept_errors on; + + # Anything under voila-server or CO2-app is authenticated. + auth_request /auth/probe; + error_page 401 = @error401; + error_page 404 = @proxy_404_error_handler; + + # caimira-co2-app is the name of the voila server in each of docker-compose, + # caimira-test.web.cern.ch and caimira.web.cern.ch. + proxy_pass http://caimira-co2-app:8080/CO2-voila-server/; + } + rewrite ^/CO2-app$ /CO2-voila-server/voila/render/caimira.ipynb last; + rewrite ^/(files/static)/(.*)$ /CO2-voila-server/voila/$1/$2 last; + + # Before implementing the nginx router we could access /voila/render/caimira.ipynb. + # Redirect this (and all other) URLs to the new scheme. + rewrite ^/voila/(.*)$ /CO2-voila-server/voila/$1 redirect; + location / { # By default we have no authentication. proxy_pass http://caimira-webservice:8080;