AddType application/javascript .mjs

#DirectoryIndex index.html spa.html
DirectoryIndex index
# DirectoryIndex spa.html

SetEnv MATOMO no

<ifModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^/?api/(.*)$ http://tibi-server:8080/api/v1/_/__NAMESPACE__/$1 [P,QSA,L]

    # Set the Host header for requests to sentry
    RequestHeader set Host sentry.basehosts.de env=proxy-sentry
    RequestHeader unset Authorization env=proxy-sentry
    # need to update project id
    RewriteRule ^/?_s(.*)$ https://sentry.basehosts.de/api/3/envelope/$1 [P,L,E=proxy-sentry:1]

    # set in vhost or global in apache
    #SSLProxyEngine On
    #SSLProxyVerify none 
    #SSLProxyCheckPeerCN off
    #SSLProxyCheckPeerName off
    #SSLProxyCheckPeerExpire off
    # set url to header for proxy

    SetEnvIf Request_URI "^(.*)$" REQUEST_URI=$1
    RequestHeader set x-ssr-url "%{REQUEST_URI}e" env=proxy-ssr
    # set env if header x-ssr-skip is set to track request
    SetEnvIfNoCase x-ssr-skip ".+" MATOMO=yes
    # append to log
    SetEnvIfNoCase x-ssr-ref "^(.+)$" LOG_REFERER=$1
    SetEnvIfNoCase x-ssr-res "^(.+)$" LOG_RESOLUTION=$1

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^/?(.*)$ http://tibi-server:8080/api/v1/_/__NAMESPACE__/ssr [P,QSA,L,E=proxy-ssr]
    # RewriteRule (.*) /spa.html [QSA,L]

</ifModule>
