stop on superfluous closing "}"
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index e06315e..1bea4f8 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -145,6 +145,12 @@
         }
 
         if (rc == NGX_CONF_BLOCK_DONE) {
+            if (!block) {
+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "unexpected \"}\"");
+                rc = NGX_ERROR;
+                break;
+            }
+
             block = 0;
         }