Thank you. Yes, that must be it! I am compiling from source and when I checked my build line I do indeed specify: --without-http_rewrite_module so I will remove that, recompile and try again. Thank you - great catch! This was a little be deceptive because I was under the impression that "if" was a built-in command.
The regular expressions module which contains the logic for "if" is called ngx_http_rewrite_module.
If you built from source and possibly left this module out then I could see an error being reported.