Skip to content

Commit

Permalink
Add traefik redirect for openapi.json [#52]
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSander committed Mar 17, 2023
1 parent 585bcda commit c794e29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/pygeoapi/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)"
Expand Down

0 comments on commit c794e29

Please sign in to comment.