I can make this map directive work:
map directive – allow origin
map $http_origin $allow_origin {
~^https?://localhost$ $http_origin;
~^https?://(www)?mysite.co.uk$ $http_origin;
default "";
}
Equivalent if statement – allow origin:
if ($http_origin ~ '^https?://(localhost|mysite.co.uk)$') {
$allow_origin=$http_origin;
}
Now I want to create another map directive based on the first one to determine if cred is true:
map directive – cred
map $http_origin $cred {
'$allow_origin' true;
default false;
}
Equivalent if statement – cred:
if ($http_origin ~ '^https?://(localhost|mysite.co.uk)$') {
$cred=true;
}
But it always returns false
How can I fix this?
thanks