services:
  # web server
  apache-php:
    labels:
      # Basic Auth Configuration (can be commented or uncommented)
      ## Block START : basicauth_apache
      - "traefik.http.middlewares.${PREFIX}-chain.chain.middlewares=${PREFIX}-redirecthttps,${PREFIX}-auth"
      - "traefik.http.middlewares.${PREFIX}-auth.basicauth.realm=${TRAEFIK_HTPASSWD_REALM}"
      - "traefik.http.middlewares.${PREFIX}-auth.basicauth.users=${TRAEFIK_HTPASSWD_USER}:${TRAEFIK_HTPASSWD_PASS}"
      - "traefik.http.routers.${PREFIX}.middlewares=${PREFIX}-chain"
      - "traefik.http.routers.${PREFIX}s.middlewares=${PREFIX}-chain"
      ## Block END : basicauth_apache

      - "traefik.http.routers.${PREFIX}s-wpjson.rule=HostRegexp(`${URL_APP}`,`{aliases:${URL_ALIAS:-default}}`,`{aliases:${URL_UNREDIRECTED:-default}}`) && PathPrefix(`/wp-json`))"
      - traefik.http.routers.${PREFIX}s-wpjson.entrypoints=https
      - traefik.http.routers.${PREFIX}s-wpjson.tls=true
      - traefik.http.routers.${PREFIX}s-wpjson.middlewares=${PREFIX}-redirecthttps

      - traefik.http.routers.${PREFIX}s.priority=99
      - traefik.http.routers.${PREFIX}s-wpjson.priority=100