apiVersion: v1
kind: ConfigMap
metadata:
  name: openidc-config
data:
  site.conf: |-
    ServerAdmin ${SERVER_ADMIN}
    ServerName ${SERVER_NAME}
    ServerTokens ProductOnly
    TraceEnable off

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogLevel ${LOG_LEVEL}

    Header unset X-Frame-Options
    Header always set X-Frame-Options SAMEORIGIN

    ProxyTimeout ${PROXY_TIMEOUT}
    OIDCOAuthTokenIntrospectionInterval 60

    <VirtualHost _default_:${HTTPD_PORT}>
        ServerAdmin ${SERVER_ADMIN}
        ServerName ${SERVER_NAME}
        ErrorLog /dev/stdout
        CustomLog "/dev/stdout" combined

        <Location ${PROXY_PATH}>
            RewriteCond %{REQUEST_METHOD} OPTIONS
            RewriteRule ^(.*)$ $1 [R=204,L]

            <Limit OPTIONS>
                Require all granted
            </Limit>

            ${AUTH_TYPE}
            ${AUTH_REQUIRE}

            ProxyPass ${PROXY_URL}
            ProxyPassReverse ${PROXY_URL}

            ${FILTER}
        </Location>

        <Location ${PROXY_PATH2}>
            RewriteEngine On
            RewriteCond %{REQUEST_METHOD} OPTIONS
            RewriteRule ^(.*)$ $1 [R=204,L]

            <Limit OPTIONS>
                Require all granted
            </Limit>

            ${AUTH_TYPE2}
            ${AUTH_REQUIRE2}

            ProxyPass ${PROXY_URL2}
            ProxyPassReverse ${PROXY_URL2}

            ${FILTER2}
        </Location>
    </VirtualHost>
