nginx configure check fault?

Igor Sysoev is at rambler-co.ru
Thu Aug 20 12:32:17 MSD 2009


On Thu, Aug 20, 2009 at 03:49:33PM +0800, lhmwzy wrote:

> Like this:
> 
> ....
>     server {
>         listen       80;
>         server_name  10.66.23.98 boy.zeuscn.com;
> 
>         #charset koi8-r;
> 
>         #access_log  /var/log/nginx-access.log;
>         access_log off
> 
>         root /usr/www/webroot;
> 
>         index  index.php index.html index.htm;
> ..........
> 
> nginx syntax check pass OK.

The attached pacth should fix the bug.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/modules/ngx_http_log_module.c
===================================================================
--- src/http/modules/ngx_http_log_module.c	(revision 2351)
+++ src/http/modules/ngx_http_log_module.c	(working copy)
@@ -837,7 +837,14 @@
 
     if (ngx_strcmp(value[1].data, "off") == 0) {
         llcf->off = 1;
-        return NGX_CONF_OK;
+        if (cf->args->nelts == 2) {
+            return NGX_CONF_OK;
+        }
+
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                           "invalid parameter \"%V\"", &value[2]);
+
+        return NGX_CONF_ERROR;
     }
 
     if (llcf->logs == NULL) {
@@ -914,6 +921,7 @@
 
     ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                        "unknown log format \"%V\"", &name);
+
     return NGX_CONF_ERROR;
 
 buffer:


More information about the nginx mailing list