@@ -197,6 +197,22 @@ server {
197197 # make sure to cache separate for languages
198198 proxy_cache_key $scheme$host$uri$is_args$args$http_accept_language;
199199
200+ include /etc/nginx/conf.d/batch_auth.include;
201+
202+ proxy_pass http://${IPV4_IP_APP_INTERNAL}:8080;
203+ }
204+
205+ # openapi.yaml should never have auth, otherwise same as /
206+ location /api/batch/openapi.yaml {
207+ auth_basic off;
208+ allow all;
209+ proxy_set_header Host $host;
210+ proxy_set_header X-Forwarded-Proto $scheme;
211+ proxy_cache ${NGINX_PROXY_CACHE};
212+ proxy_cache_valid 200 1m;
213+ proxy_cache_use_stale updating error timeout invalid_header http_500 http_502 http_503 http_504;
214+ expires 1m;
215+ proxy_cache_key $scheme$host$uri$is_args$args$http_accept_language;
200216 proxy_pass http://${IPV4_IP_APP_INTERNAL}:8080;
201217 }
202218
@@ -255,20 +271,6 @@ server {
255271 return 301 http://${subdomain}conn.${INTERNETNL_DOMAINNAME}/connection/;
256272 }
257273
258- # batch API, requires authentication and passes basic auth user to Django App via headers
259- location /api/batch/v2 {
260- auth_basic "Please enter your batch username and password";
261- auth_basic_user_file /etc/nginx/htpasswd/external/batch_api.htpasswd;
262-
263- # pass logged in user to Django
264- proxy_set_header REMOTE-USER $remote_user;
265-
266- # pass host for Django's allowed_hosts
267- proxy_set_header Host $host;
268-
269- proxy_pass http://${IPV4_IP_APP_INTERNAL}:8080;
270- }
271-
272274 # monitoring, requires authentication
273275 location /grafana {
274276 auth_basic "Please enter your username and password";
0 commit comments