NGINX locations: performance impact and optimizations

NGINX location and rewrite directives. What are the best practices?