Welcome! Log In Create A New Profile

Advanced

nginx embedded perl и upload module

Roman Vasilyev
December 02, 2011 05:12PM
добрался до следующей проблемы:
требуется перед обработчиком upload module дернуть perl handler с
мелкими проверками загружаемого файла.

sub handler {
my $r = shift;
return 402 if $r->request_method ne "POST";
......
return 410 if $time > $exp;
return 405 if $maxSize >0 and $size>$maxSize;
}

location /upload {
perl my::handler;
upload_pass blah;
upload_store blah/blah;
}

не срабатывет, посмотрев в исходник вижу следующее:

ngx_http_perl_module.c:
=============================
static char *
ngx_http_perl(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
...
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
clcf->handler = ngx_http_perl_handler;
...
}

ngx_http_upload_module.c
=============================
static char * /* {{{ ngx_http_upload_pass */
ngx_http_upload_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
...
clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
clcf->handler = ngx_http_upload_handler;
...
}

похоже, что обработчик одного модуля перетирает другой.
Понимаю что оба модуля лазят достаточно глубоко в потроха сервера, хотел
спросить, есть ли выход из данной ситуации, кто бы что мог посоветовать?

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx embedded perl и upload module

Roman Vasilyev December 02, 2011 05:12PM

Re: nginx embedded perl и upload module

Alexandr Gomoliako December 02, 2011 05:24PM

Re: nginx embedded perl и upload module

Valery Kholodkov December 02, 2011 05:40PM

Re: nginx embedded perl и upload module

Roman Vasilyev December 02, 2011 06:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 226
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready