The following block
location / {
if ($http_origin ~* (https?://[^/]*\.example\.com(:[0-9]+)?)) {
add_header 'Access-Control-Allow-Origin' "$http_origin";
}
try_files $uri $uri/ /index.php?$args;
}
… causes a 404 as the above code never reaches the try_files
directive, so:
Is this related to the IfIsEvil of nginx?
If it is, then is there some other way to test the
http_origin
by not using an if statement?
I have tried this with nginx > 1.4 (1.4.6, 1.7, 1.7.8).