Igor S. ha scritto:
There is somethig wrong, here.
I’m using now 0.5.33.
In ngx_http_wsgi_create_loc_conf I set:
wlcf->callable_object = NGX_CONF_UNSET_PTR;
and in ngx_http_wsgi_merge_loc_conf:
ngx_conf_merge_ptr_value(conf->callable_object, prev->callable_object,
“application”);
When directive wsgi_callable_object is not defined, then it defaults to
“application”.
However if I define the directive in configuration file:
location / {
wsgi_alias /usr/local/nginx/nginx-simple.py;
wsgi_callable_object application;
}
I get a:
2007/11/25 18:07:08 [emerg] 19458#0: “wsgi_callable_object” directive is
duplicate in nginx-simple.conf:51
To understand how this works, I have tested fastcgi_catch_stderr (not
documented):
location /test {
fastcgi_pass 127.0.0.1:9000;
fastcgi_catch_stderr ops;
}
but I get a segmentation fault:
(gdb) run -c nginx-simple.conf
Starting program: /usr/local/nginx/sbin/nginx -c nginx-simple.conf
Failed to read a valid object file image from memory.
[Thread debugging using libthread_db enabled]
[New Thread -1213540672 (LWP 19510)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1213540672 (LWP 19510)]
ngx_array_push (a=0xffffffff) at src/core/ngx_array.c:59
59 if (a->nelts == a->nalloc) {
(gdb) bt
#0 ngx_array_push (a=0xffffffff) at src/core/ngx_array.c:59
#1 0x08058761 in ngx_conf_set_str_array_slot (cf=0xbf83df4c,
cmd=0x80ac618, conf=0x80cead4) at src/core/ngx_conf_file.c:935
#2 0x08059715 in ngx_conf_parse (cf=0xbf83df4c, filename=0x0) at
src/core/ngx_conf_file.c:336
#3 0x0806b7f7 in ngx_http_core_location (cf=0xbf83df4c, cmd=0x80a7aac,
dummy=0x80ccf34) at src/http/ngx_http_core_module.c:1915
#4 0x08059715 in ngx_conf_parse (cf=0xbf83df4c, filename=0x0) at
src/core/ngx_conf_file.c:336
#5 0x0806ba25 in ngx_http_core_server (cf=0xbf83df4c, cmd=0x80a79b0,
dummy=0x80c31f0) at src/http/ngx_http_core_module.c:1706
#6 0x08059715 in ngx_conf_parse (cf=0xbf83df4c, filename=0x0) at
src/core/ngx_conf_file.c:336
#7 0x080682c1 in ngx_http_block (cf=0xbf83df4c, cmd=0x80a77e0,
conf=0x80c2cd8) at src/http/ngx_http.c:218
#8 0x08059715 in ngx_conf_parse (cf=0xbf83df4c, filename=0x80c263c) at
src/core/ngx_conf_file.c:336
#9 0x080571df in ngx_init_cycle (old_cycle=0xbf83dfbc) at
src/core/ngx_cycle.c:216
#10 0x0804d8b9 in main (argc=3, argv=0xbf83e104) at src/core/nginx.c:291
So this seems a bug in the NGX_CONF_UNSET_PTR / ngx_conf_merge_ptr_value
logic.
Thanks Manlio P.