Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

This is a nginx module that reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded", and parse the arguments in request body into nginx variables.

NotificationsYou must be signed in to change notification settings

calio/form-input-nginx-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

form-input-nginx-module - NGINX module that reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded" and parses the arguments into nginx variables.

Table of Contents

Description

This is a nginx module that reads HTTP POST and PUT request body encodedin "application/x-www-form-urlencoded", and parse the arguments inrequest body into nginx variables.

This module depends on the ngx_devel_kit (NDK) module.

Installation

Grab the nginx source code fromnginx.org, for example,the version 1.9.15 (seenginx compatibility), and then build the source with this module:

wget'http://nginx.org/download/nginx-1.9.15.tar.gz'tar -xzvf nginx-1.9.15.tar.gzcd nginx-1.9.15/./configure --add-module=/path/to/ngx_devel_kit \    --add-module=/path/to/form-input-nginx-modulemake -j2make install

Download the latest version of the release tarball of this module fromform-input-nginx-module file list, and the latest tarball forngx_devel_kit from itsfile list.

Building as a dynamic module

Starting from NGINX 1.9.11, you can also compile this module as a dynamic module, by using the--add-dynamic-module=PATH option instead of--add-module=PATH on the./configure command line above. And then you can explicitly load the module in yournginx.conf via theload_moduledirective, for example,

load_module /path/to/modules/ndk_http_module.so;# assuming NDK is built as a dynamic module tooload_module /path/to/modules/ngx_http_form_input_module.so;

Back to TOC

Usage

set_form_input$variable;set_form_input$variable argument;set_form_input_multi$variable;set_form_input_multi$variable argument;

example:

#nginx.conflocation/foo{# ensure client_max_body_size == client_body_buffer_sizeclient_max_body_size100k;client_body_buffer_size100k;set_form_input$data;# read "data" field into $dataset_form_input$foo foo;# read "foo" field into $foo}location/bar{# ensure client_max_body_size == client_body_buffer_sizeclient_max_body_size1m;client_body_buffer_size1m;set_form_input_multi$data;# read all "data" field into $dataset_form_input_multi$foo data;# read all "data" field into $fooarray_join' '$data;# now $data is an stringarray_join' '$foo;# now $foo is an string}

Back to TOC

Limitations

  • ngx_form_input will discard request bodies that are bufferedto disk files. When the client_max_body_size setting is larger thanclient_body_buffer_size, request bodies that are largerthan client_body_buffer_size (but no larger thanclient_max_body_size) will be buffered to disk files.So it's important to ensure these two config settings takethe same values to avoid confustion.

Back to TOC

Compatibility

The following versions of Nginx should work with this module:

  • 1.9.x (last tested: 1.9.15)
  • 1.8.x
  • 1.7.x (last tested: 1.7.4)
  • 1.6.x
  • 1.5.x (last tested: 1.5.12)
  • 1.4.x (last tested: 1.4.6)
  • 1.1.x (last tested: 1.1.5)
  • 1.0.x (last tested: 1.0.8)
  • 0.9.x (last tested: 0.9.4)
  • 0.8.x >= 0.8.54

Back to TOC

Copyright & License

Copyright (c) 2010, 2011, Jiale "calio" Zhivipcalio@gmail.com.

Copyright (c) 2010-2016, Yichun "agentzh" Zhangagentzh@gmail.com, CloudFlare Inc.

This module is licensed under the terms of the BSD license.

Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions aremet:

  • Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "ASIS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITEDTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR APARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHTHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITEDTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Back to TOC

About

This is a nginx module that reads HTTP POST and PUT request body encoded in "application/x-www-form-urlencoded", and parse the arguments in request body into nginx variables.

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp