mercredi 10 juillet 2019

How to debug if/elseif in Apache httpd.conf?

Running Apache 2.4.38 on Windows 2012. I have the following config in my httpd.conf

<IfModule mod_headers.c>
<If "%{THE_REQUEST} =~ m#.*smartbank.*#">
    Header set Access-Control-Allow-Credentials: "true"
    Header set Access-Control-Allow-Methods: "GET"
    Header set Access-Control-Allow-Origin: "https://bank.test.mycorp.no"
    Header set Vary: Origin
</If>
<ElseIf "%{THE_REQUEST} =~ m#.*startside.*#">
    Header set Access-Control-Allow-Credentials: "true"
    Header set Access-Control-Allow-Methods: "GET"
    Header set Access-Control-Allow-Origin: "https://testserver1.mycorp.no"
    Header set Vary: Origin
</ElseIf>
<ElseIf "%{HTTP_HOST} == 'localhost:8080'">
    Header set Access-Control-Allow-Credentials: "true"
    Header set Access-Control-Allow-Methods: "GET"
    Header set Access-Control-Allow-Origin: "http://localhost:8080"
    Header set Vary: Origin
</ElseIf>

For some reason the first elseif won't kick in. Is it any in any way possible to debug such statements, such as create log statements before, in and after the if else?

Aucun commentaire:

Enregistrer un commentaire