> Is this expected behaviour? Could there be another way to do this?

'if' (the rewrite module) is executed in early stages when $sent_* variables 
are not available that’s why the regex doesn't match.

What you could do is use 'map' instead:
(http://nginx.org/en/docs/http/ngx_http_map_module.html )


map $sent_http_link $IS_WORDPRESS  {
   ~*.*wp-json.* "true";
    default "false";
}

And then:

add_header                    X-Is-WordPress $IS_WORDPRESS;

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to