(#11671) add support for rewrite_rules and extra directives

Rewrite rules can now be added though the correct NGINX way is using
location directives and try_files (or supporting it properly in the
application).