From c794e29b681cae1bb5f5cf2a3fe1a9f7cfaefcc3 Mon Sep 17 00:00:00 2001 From: Sander Schaminee Date: Fri, 17 Mar 2023 15:27:21 +0100 Subject: [PATCH] Add traefik redirect for openapi.json [#52] --- services/pygeoapi/docker-compose.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/pygeoapi/docker-compose.yml b/services/pygeoapi/docker-compose.yml index ef92b0e..ee41341 100644 --- a/services/pygeoapi/docker-compose.yml +++ b/services/pygeoapi/docker-compose.yml @@ -73,7 +73,11 @@ services: - "traefik.http.routers.${SERVICE_NAME_ADR}_https.tls=${TRAEFIK_USE_TLS}" - "traefik.http.routers.${SERVICE_NAME_ADR}_https.tls.certresolver=${TRAEFIK_SSL_CERT_RESOLVER}" - "traefik.http.routers.${SERVICE_NAME_ADR}_https.tls.options=my_default@file" - - "traefik.http.routers.${SERVICE_NAME_ADR}_https.middlewares=secure-headers@file" + - "traefik.http.routers.${SERVICE_NAME_ADR}_https.middlewares=secure-headers@file,openapi" + + # Redirect for openapi.json that Dutch ADR validator needs + - "traefik.http.middlewares.openapi.redirectregex.regex=^https:\\/\\/(.*)\\/openapi\.json$$" + - "traefik.http.middlewares.openapi.redirectregex.replacement=https://$$1/openapi?f=json" # Define local http router - "traefik.http.routers.${SERVICE_NAME_ADR}_http.rule=Host(`localhost`) && PathPrefix(`${SERVICE_PATH_ADR}`)"