Using nginx >1.4.6 thebelow example fails with a 404.
location / {
if ($request_method = 'GET') {
set $cors "${cors}get";
}
try_files $uri $uri/ /index.php?$args;
}
The above code breaks within the if and never reaches the try_files statement.
Seems like a set directive within an if statement causes nginx to break. In fact any directive inside an if statement triggers http://wiki.nginx.org/IfIsEvil
Hi,
The example on the enable-cors.org site fails within the if blocks here:
http://enable-cors.org/server_nginx.html
Using nginx >1.4.6 thebelow example fails with a 404. location / { if ($request_method = 'GET') { set $cors "${cors}get";
}
try_files $uri $uri/ /index.php?$args; }
The above code breaks within the if and never reaches the try_files statement. Seems like a set directive within an if statement causes nginx to break. In fact any directive inside an if statement triggers http://wiki.nginx.org/IfIsEvil