Accept cookies for analytics, social media, and advertising, or learn more and adjust your preferences. These cookies are on by default for visitors outside the UK and EEA. Privacy Notice.
form-input-nginx-module - an NGINX module that reads HTTP POST and PUT request body encoded in
application/x-www-form-urlencoded
, and parses the arguments in request body
into NGINX variables.
This module depends on the ngx_devel_kit (NDK) module.
$ wget 'http://sysoev.ru/nginx/nginx-0.8.28.tar.gz'
$ tar -xzvf nginx-0.8.28.tar.gz
$ cd nginx-0.8.28/
$ git-clone http://github.com/simpl-it/ngx_devel_kit.git
$ git-clone http://github.com/calio/form-input-nginx-module.git
$ ./configure --add-module=/somepath/form-input-nginx-module --add-module=/somepath/ngx_devel_kit
$ make -j2
$ make install
set_form_input $variable;
set_form_input $variable argument;
set_form_input_multi $variable;
set_form_input_multi $variable argument;
Example:
#nginx.conf
location /foo {
set_form_input $data; # read "data" field into $data
set_form_input $foo foo; # read "foo" field into $foo
}
location /bar {
set_form_input_multi $data; # read all "data" field into $data
set_form_input_multi $foo data; # read all "data" field into $foo
array_join ' ' $data; # now $data is a string
array_join ' ' $foo; # now $foo is a string
}
The following versions of NGINX should work with this module:
Copyright (c) 2010, Taobao Inc., Alibaba Group ( http://www.taobao.com/market/global/index_new.php ).
Copyright (c) 2010, calio <vipcalio@gmail.com>.
This module is licensed under the terms of the BSD license.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Changes with form-input-module v0.0.2
- Supports
set_form_input_multi
- Supports
PUT
method
Changes with form-input-module v0.0.1
- Supports
set_form_input