[ANN] OpenResty released

Yichun Zhang (agentzh) agentzh at gmail.com
Mon Nov 23 14:23:05 UTC 2015

Hi guys,

I am glad to announce the new formal release,, of the
OpenResty bundle:


The first highlight of this release is the new *_by_lua_block {} directives
added in the ngx_http_lua module.

For example, instead of writing

    content_by_lua '
        ngx.say("Hello, OpenResty\'s world!\\n")

We can just write

    content_by_lua_block {
        ngx.say("Hello, OpenResty's world!\n")

No ugly special character escaping is needed in the Lua source any
more in the latter form :)

The second highlight of this release is the new (experimental) support for
Windows using the MinGW gcc toolchain. You can download the pre-built Win32
binaries from this zip package:


For detailed usage on Windows, please check out the following document:


If you want to build on Windows yourself, then this document contains
detailed instructions as well.

We will release a corresponding Win32 binary package for every release
of the OpenResty source package from now on.

The Windows build is still experimental and should be used for development only.

We have plans to migrate to the Microsoft Visual Studio compiler
toolchain and to resolve existing limitations on Windows in the near

Changes since the last (formal) release,

 *   feature: added support for compiling on Windows using the MinGW
     gcc toolchain to the build system. See the document for more


 *   upgraded the ngx_lua module to 0.9.19.

     *   feature: implemented "*_by_lua_block {}" directives for all
         the existing *_by_lua directives so that we no longer have
         to escape special characters while inlining Lua source
         inside the "nginx.conf" file.

     *   feature: now we support LuaJIT 2 on Windows (in the form of

     *   feature: initial fixes when being used with the new
         "ngx_http_v2" module since nginx 1.9.5. thanks itpp16 for
         the patches.

     *   bugfix: fixed errors and warnings with C compilers without
         variadic macro support.

     *   bugfix: subrequest response status codes between the range
         100 .. 299 (inclusive) might get lost in the return values
         of ngx.location.capture*() calls. thanks Igor Clark for the

     *   bugfix: we might return the wrong shm zone in the public C
         API function "ngx_http_lua_find_zone()". thanks qlee001 for
         the report.

     *   bugfix: the user specified "./configure"'s "--with-cc-opt"
         and "--with-ld-opt" might override the
         environment settings. thanks Julian Gonggrijp for the

     *   bugfix: setting builtin request header "Upgrade" via
         ngx.req.set_header and etc might not take effect with some
         builtin nginx modules.

     *   bugfix: setting builtin request headers "Depth",
         "Destination", "Overwrite", and "Date" via
         ngx.req.set_header() and etc might not take effect at least
         with ngx_http_dav_module. thanks Igor Clark for the report.

     *   bugfix: fixed typos due to copy&paste mistakes in some error

     *   bugfix: fixed one "-Wmaybe-uninitialized" warning when
         compiling with "gcc -Os".

     *   bugfix: use of shared dicts resulted in (unwanted)
         registrations of shared dict metatables on *all* the
         lightuserdata in the Lua space. thanks helloyi for the
         report and patch.

     *   bugfix: if a 3rd-party module calls
         "ngx_http_conf_get_module_srv_conf" to fetch its current
         "srv_conf" construct in its "merge_srv_conf" callback, then
         use of init_worker_by_lua might lead to segmentation faults
         (the same also applied to merge_loc_conf). thanks chiyouhen
         for the report and patch.

     *   bugfix: the "if_unmodified_since" "shortcut" field in
         "ngx_http_headers_in_t" was first added in nginx 0.9.2.

     *   bugfix: ngx.req.clear_header/ngx.req.set_header: we did not
         update the shortcut fields in "ngx_http_headers_in_t" added
         since nginx 1.3.3 which may confuse other nginx modules
         accessing them.

     *   bugfix: setting "Content-Type" response values including ";
         charset=xxx" via the ngx.header API might bypass the MIME
         type checks in other nginx modules like ngx_gzip. thanks
         Andreas Fischer for the report.

     *   bugfix: typo fixes in some debug logging messages. thanks
         doujiang for the patch.

     *   optimize: fixed the hash-table initial sizes of the cosocket
         metatables. thanks ops-dev-cn for the patch.

     *   tests: removed the useless "use lib" directives from the
         Perl test files. thanks Markus Linnala for the report.

     *   doc: various typo fixes from Lance Li.

     *   doc: ngx.exit was not disabled within the
         header_filter_by_lua* context.

     *   doc: a code example misses a "return". thanks YuanSheng Wang
         for the patch.

     *   doc: ngx.var: documented the values for undefined and
         uninitialized nginx variables. thanks Sean Johnson for

     *   doc: typo fix from Tatsuya Hoshino.

 *   upgraded the ngx_lua_upstream module to 0.04.

     *   feature: "upstream.get_servers(server_name)" now returns the
         server name (if any) as well, which can be the domain name
         if the user puts it in "nginx.conf". thanks Hung Nguyen for
         the request.

 *   upgraded the ngx_headers_more module to 0.28.

     *   bugfix: fixed errors and warnings with C compilers without
         variadic macro support.

     *   bugfix: setting (builtin) request headers "Upgrade",
         "Depth", "Destination", "Overwrite", and "Date" might not
         take effect in standard nginx modules like ngx_http_proxy
         and ngx_http_dav.

     *   bugfix: when the response header "Content-Type" contains
         parameters like "; charset=utf-8", the "-t MIME-List"
         options did not work as expected at all. thanks Joseph
         Bartels for the report.

     *   bugfix: clearing input headers "If-Unmodified-Since",
         "If-Match", and "If-None-Match" did not clear the builtin
         "shortcut" fields in "ngx_http_headers_in_t" which might
         confuse other nginx modules like
         "ngx_http_not_modified_filter_module". The first header gets
         "shortcuts" fields since nginx 0.9.2 while the latter two
         since nginx 1.3.3.

 *   upgraded the ngx_iconv module to 0.13.

     *   bugfix: HTTP 0.9 requests would turn "iconv_filter" into a
         bad unrecoverable state leading to "iconv body filter
         skiped" error upon every subsequent request. thanks
         numberlife for the report. also introduced some coding style

     *   bugfix: lowered the error log level for HTTP 0.9 requests
         from "error" to "warn" to prevent malicious clients from
         flooding the error logs.

 *   upgraded lua-resty-redis to 0.21.

     *   bugfix: the "attempt to call local new_tab (a table value)"
         error might happen when LuaJIT 2.0 was used and a local Lua
         module named "table.new" was visible. thanks Michael Pirogov
         for the report.

     *   doc: fixed code examples to check redis pipelined requests'
         return values more strictly. some commands (like hkeys and
         smembers) may return empty tables, which may result in "nil
         res[1]" values. thanks Dejiang Zhu for the patch.

 *   upgraded the lua-resty-core library to 0.1.2.

     *   change: updated the implementation to reflect recent changes
         in shared dictionary zones of the ngx_lua module. now we require
         the ngx_lua module 0.9.17+.

 *   upgraded the lua-cjson library to

     *   feature: now we allow up to 16 decimal places in JSON number
         encoding via "cjson.encode_number_precision()". thanks
         lordnynex for the patch.

     *   bugfix: fixed the warning "inline function ‘fpconv_init’
         declared but never defined" from gcc.

     *   bugfix: Makefile: removed the slash ("/") after "$(DESTDIR)"
         so as to support relative path values in make variable

 *   upgraded resty-cli to 0.04.

     *   feature: now the "resty" command-line utility looks for an
         nginx under the directory of itself as well (for Win32

     *   bugfix: worked around a bug regarding temp directory cleanup
         in msys perl 5.8.8 (and possibly other versions of msys perl
         as well).

     *   bugfix: ensure we append an appropriate executable file
         extension when testing the existence of executables on
         exotic systems like Win32.

 *   upgraded the lua-rds-parser library to 0.06.

     *   bugfix: fixed the "u_char" C data type for MinGW gcc which
         lacks it.

     *   bugfix: Makefile: added an explicit ".c -> .o" rule to help
         MinGW make.

     *   bugfix: Makefile: removed the slash ("/") after "$(DESTDIR)"
         so as to support relative path values in make variable

 *   upgraded the lua-redis-parser library to 0.12.

     *   bugfix: Makefile: added an explicit ".c -> .o" rule to help
         MinGW make.

     *   bugfix: Makefile: removed the slash ("/") after "$(DESTDIR)"
         so as to support relative path values in make variable

 *   upgraded the ngx_rds_csv module to 0.07.

     *   bugfix: fixed compilation errors with MinGW gcc on Win32.

     *   bugfix: fixed errors and warnings with C compilers without
         variadic macro support.

 *   upgraded LuaJIT to v2.1-20151028:

     *   imported Mike Pall's latest changes:

         *   limit number of arguments given to "io.lines()" and

         *   ARM64: fix "__call" metamethod handling for tail calls.

         *   FFI: Do not propagate qualifiers into subtypes of

         *   feature: parse binary number literals ("0bxxx").

         *   fix NYICF error message.

         *   properly handle OOM in "trace_save()".

         *   ARM64: add support for saving bytecode as object files.

         *   ARM64: fix ELF bytecode saving.

         *   feature: parse Unicode string escape "\u{XX...}".

         *   FFI: add "ssize_t" declaration.

         *   fix unsinking check.

         *   feature: add "collectgarbage("isrunning")".

         *   flush symbol tables in "jit.dump" on trace flush.

The HTML version of the change log with lots of helpful hyper-links
can be browsed here:


OpenResty (aka. ngx_openresty) is a full-fledged web
platform by bundling the standard Nginx core, Lua/LuaJIT, lots of
3rd-party Nginx
modules and Lua libraries, as well as most of their external
dependencies. See OpenResty's homepage for details:


We have run extensive testing on our Amazon EC2 test cluster and
ensured that all the components (including the Nginx core) play well
together. The latest test report can always be found here:


Have fun!

More information about the nginx mailing list