<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity=60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:1.35em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:2em;}
h2 {font-size:1.75em;}
h3 {font-size:1.7em;}
h4 {font-size:1.6em;}
h5 {font-size:1.5em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])

<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]

----
Also see [[AdvancedOptions]]
<<importTiddlers>>
<<toolbar permalink>>

This bundle is mainly maintained by Yichun Zhang ([[agentzh|http://agentzh.org]]). It was originally sponsored by [[Taobao.com|http://www.taobao.com]] before the year 2011 and it has been mainly supported by [[CloudFlare|http://www.cloudflare.com]] since then.

Because most of the Nginx modules are developed by the bundle maintainers, it can be ensured
that all these modules are played well together.

The bundled software components are copyrighted by the respective copyright holders.  Basically only components with BSD style licenses are included. If you find exceptions, please let me know.

This web site is a [[TiddlyWiki|http://www.tiddlywiki.com/]] page that is under the version control of a repository on GitHub:

http://github.com/agentzh/openresty.org

Feel free to fork it or just [[contact us|ContactUs]] to obtain a git commit bit if you want to edit and improve this site.
<<toolbar permalink>>

This [[Nginx]] module adds support for array variables to nginx config files.

Project page: https://github.com/agentzh/array-var-nginx-module
<<toolbar permalink>>

Introduction: http://www.ruby-forum.com/topic/205063

Project page: http://mdounin.ru/hg/ngx_http_auth_request_module/
<<toolbar permalink>>
!~HelloWorld
Testing the performance of a ~HelloWorld server does not mean many things but it does tell us where the ceiling is.

The ~HelloWorld server based on OpenResty is described in the [[GettingStarted]] document.

Below is the result using the command {{{http_load -p 10 -s 5 http://localhost:8080/}}} on my ~ThinkPad T400 laptop with ngx_openresty 1.0.10.1:
{{{
139620 fetches, 10 max parallel, 1.67544e+06 bytes, in 5.00001 seconds
12 mean bytes/connection
27923.9 fetches/sec, 335087 bytes/sec
msecs/connect: 0.0531258 mean, 4.076 max, 0.014 min
msecs/first-response: 0.258796 mean, 5.353 max, 0.067 min
HTTP response codes:
  code 200 -- 139620
}}}

So on my laptop, for only a single worker nginx server, we've got ~28k r/s. The memory footprint of the {{{node}}} process under load is 38.0m VIRT, 2.5m RES.

For comparison, ~HelloWorld servers using nginx + php-fpm 5.2.8 gives ~6k r/s:
{{{
http_load -p 10 -s 5 url
29703 fetches, 10 max parallel, 326733 bytes, in 5 seconds
11 mean bytes/connection
5940.6 fetches/sec, 65346.6 bytes/sec
msecs/connect: 0.0394686 mean, 1.172 max, 0.02 min
msecs/first-response: 1.62616 mean, 6.744 max, 0.719 min
HTTP response codes:
  code 200 -- 29703
}}}
And [[node.js|http://nodejs.org/]] v0.6.1 yields 10k r/s:
{{{
51206 fetches, 10 max parallel, 614472 bytes, in 5 seconds
12 mean bytes/connection
10241.2 fetches/sec, 122894 bytes/sec
msecs/connect: 0.0356567 mean, 1.316 max, 0.019 min
msecs/first-response: 0.916395 mean, 14.236 max, 0.077 min
HTTP response codes:
  code 200 -- 51206
}}}
The memory footprint of the {{{node}}} process under load is 629m  VIRT, 50m RES.

!! For Mac OS X Lion Users
Note that Mac OS X Lion has known issues that need to be fixed on your system before attempting to replicate our benchmark results.

In brief, raise the number of  available ephemeral ports using [[this fix|http://serverfault.com/questions/145907/does-mac-os-x-throttle-the-rate-of-socket-creation]].

Compile an up-to-date version of ab (Apache's benchmark tool) according to [[this post|http://superuser.com/questions/323840/apache-bench-test-erroron-os-x-apr-socket-recv-connection-reset-by-peer-54]].

Then, {{{ab -k -c10 -n10000 -t1 -r 'http://127.0.0.1:8080/'}}} will deliver benchmark results.

Otherwise use an alternative lightweight HTTP load-testing tool [[weighttp|http://redmine.lighttpd.net/projects/weighttp/wiki]] and the invocation {{{weighttp -k -c10 -n10000 'http://127.0.0.1:8080/'}}} for benchmarking.
<<toolbar permalink>>
{{{
sudo yum install gcc gcc-c++ -y
cd /tmp/
wget https://fedorahosted.org/releases/e/l/elfutils/0.159/elfutils-0.159.tar.bz2
tar -xvf elfutils-0.159.tar.bz2
wget https://sourceware.org/systemtap/ftp/releases/systemtap-2.5.tar.gz
tar -xvf systemtap-2.5.tar.gz
cd systemtap-2.5/
./configure --prefix=/opt/stap --disable-docs \
            --disable-publican --disable-refdocs CFLAGS="-g -O2" \
            --with-elfutils=../elfutils-0.159
make -j8
sudo make install
}}}
And then invoke stap like this:
{{{
$ /opt/stap/bin/stap -V
Systemtap translator/driver (version 2.5/0.158, non-git sources)
Copyright (C) 2005-2014 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBRPM LIBSQLITE3 NSS BOOST_SHARED_PTR TR1_UNORDERED_MAP NLS LIBXML2
}}}
Or you can just add the {{{/opt/stap/bin}}} path to your {{{PATH}}} environment.
<<toolbar permalink>>
! Stable Release 1.0.4.2 - 9 August 2011
This release is the same as  1.0.4.2rc13.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1rc3
* echo-nginx-module-0.37rc1
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.15
* iconv-nginx-module-0.10rc4
* lua-5.1.4
* memc-nginx-module-0.12
* nginx-1.0.4
* ngx_devel_kit-0.2.17
* ngx_lua-0.2.1rc4
* ngx_postgres-0.9rc1
* rds-json-nginx-module-0.12rc1
* redis2-nginx-module-0.07
* set-misc-nginx-module-0.22rc2
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.4.2rc13 - 8 August 2011
* now we bundle a Perl 5 script to serve as the {{{install}}} script for LuaJIT 2.0 on Solaris. now OpenResty builds successfully on Solaris 11 with LuaJIT enabled!
! Mainline Version 1.0.4.2rc12 - 8 August 2011
* bundled {{{gcc}}}'s {{{unwind-generic.h}}} for BSD because {{{unwind.h}}} is missing at least on ~FreeBSD.
! Mainline Version 1.0.4.2rc11 - 8 August 2011
* use absoluate paths in Makefile to prevent {{{-jN}}} errors when using bsdmake on ~FreeBSD.
! Mainline Version 1.0.4.2rc10 - 7 August 2011
* upgraded ngx_lua to v0.2.1rc4.
** worked-around the "stack overflow" issue while using luarocks.loader and disabling {{{lua_code_cache}}}, as described as [[github issue #27|https://github.com/chaoslawful/lua-nginx-module/issues/27]]. thanks Patrick Crosby.
! Mainline Version 1.0.4.2rc9 - 7 August 2011
* now we use {{{gmake}}} if it is available in {{{PATH}}} during {{{./configure}}}; also added the {{{--with-make=PATH}}} option to allow the user to specify a custom {{{make}}} utility.
! Mainline Version 1.0.4.2rc8 - 6 August 2011
* fixed a regression that we should use the {{{CC}}} variable instead of {{{HOST_CC}}} while passing the {{{--with-cc}}} option to the LuaJIT 2.0 build system. thanks @姜大炮 for reporting this issue.
! Mainline Version 1.0.4.2rc7 - 5 August 2011
*  upgraded ngx_lua to v0.2.1rc3.
** fixed the {{{zero size buf in output}}} alert while combining {{{lua_need_request_body on}}} + {{{access_by_lua/rewrite_by_lua}}} + {{{proxy_pass/fastcgi_pass}}}. thanks 万珣新.
! Mainline Version 1.0.4.2rc6 - 5 August 2011
* added the {{{--with-pg_config}}} option to the {{{./configure}}} script as per 罗翼's request.
! Mainline Version 1.0.4.2rc5 - 5 August 2011
* added the {{{--with-no-pool-patch}}} option to the {{{./configure}}} script, to allow enabling the no-pool patch for debugging memory issues with valgrind, for example.
! Mainline Version 1.0.4.2rc4 - 4 August 2011
* added the {{{--with-libpq=DIR}}} option to the {{{./configure}}} script. thanks 郭颖 for suggesting this.
! Mainline Version 1.0.4.2rc3 - 4 August 2011
* upgraded ngx_drizzle to v0.1.1rc3.
** fixed segmentation faults on Linux i386. thanks @魏世江 and @stefanli for reporting this issue.
! Mainline Version 1.0.4.2rc2 - 4 August 2011
* fixed a regression while specifying {{{--with-http_iconv_module}}} during {{{./configure}}}. thanks 冯新国 for reporting this issue.
! Mainline Version 1.0.4.2rc1 - 30 July 2011
* upgraded ngx_set_misc to 0.22rc2.
** added the set_misc_base32_padding directive.
! Stable Release 1.0.4.1 - 30 July 2011
This release is the same as  1.0.4.1rc6.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1rc2
* echo-nginx-module-0.37rc1
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.15
* iconv-nginx-module-0.10rc4
* lua-5.1.4
* memc-nginx-module-0.12
* nginx-1.0.4
* ngx_devel_kit-0.2.17
* ngx_lua-0.2.1rc2
* ngx_postgres-0.9rc1
* rds-json-nginx-module-0.12rc1
* redis2-nginx-module-0.07
* set-misc-nginx-module-0.22rc1
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.4.1rc6 - 28 July 2011
* fixed a regression in {{{./configure}}} when enabling luajit in 1.0.4.1rc5. thanks @Lance.
! Mainline Version 1.0.4.1rc5 - 26 July 2011
* upgraded ngx_iconv to 0.10rc3, ngx_form_input to 0.07rc5, ngx_array_var to 0.03rc1, and ngx_set_misc to 0.22rc1.
* now {{{--with-debug}}} option also enables the {{{gcc -g}}} compilation option for LuaJIT.
* disabled target stripping in LuaJIT.
! Mainline Version 1.0.4.1rc4 - 25 July 2011
* applied the official hotfix #1 patch for LuaJIT 2.0.0 beta8.
! Mainline Version 1.0.4.1rc3 - 23 July 2011
* now the {{{--with-cc}}} option of {{{./configure}}} also controls the C compiler used by Lua and LuaJIT. thanks @姜大炮 for reporting the issue.
! Mainline Version 1.0.4.1rc2 - 23 July 2011
* upgraded ngx_lua to v0.2.1rc2 and ngx_redis2 to v0.07.
! Mainline Version 1.0.4.1rc1 - 14 July 2011
* upgraded ngx_rds_json to v0.12rc1, ngx_drizzle to v0.1.1rc2, ngx_lua to v0.2.1rc1, ngx_postgres to v0.9rc1, ngx_redis2 to v0.07rc6.
* now we no longer enable {{{gcc -O2}}} by default, because it's bad for debugging issues.
* fixed linking issues when doing {{{./configure --with-cc-opt=-fast}}} on Mac OS X. thanks @姜大炮.
! Stable Release 1.0.4.0 - 12 July 2011
This release is the same as  1.0.4.0rc5.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.02
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1rc1
* echo-nginx-module-0.37rc1
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc4
* headers-more-nginx-module-0.15
* iconv-nginx-module-0.10rc3
* lua-5.1.4
* memc-nginx-module-0.12
* nginx-1.0.4
* ngx_devel_kit-0.2.17
* ngx_lua-0.2.0
* ngx_postgres-0.8
* rds-json-nginx-module-0.11
* redis2-nginx-module-0.07rc5
* set-misc-nginx-module-0.21
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.4.0rc5 - 12 July 2011
* upgraded ngx_drizzle to v0.1.1rc1.
! Mainline Version 1.0.4.0rc4 - 11 July 2011
* upgraded ngx_echo to v0.37rc1.
* we no longer require ~ExtUtils::~MakeMaker and Config because they're not standard packages and are missing on a default ~CentOS 6 build. thanks Lance for reporting it.
! Mainline Version 1.0.4.0rc2 - 11 July 2011
* upgraded ngx_srcache to v0.12.
! Mainline Version 1.0.4.0rc1 - 8 July 2011
* based on ngx_openresty 0.8.54.9, but with nginx core upgraded to nginx 1.0.4.

See [[ChangeLog8054]] for change log for ngx_openresty 0.8.54.x.
<<toolbar permalink>>
! Stable Release 1.0.5.1 - 4 September 2011
This release is almost the same as 1.0.5.1rc14, but upgraded LuaNginxModule to v0.3.0.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1rc4
* echo-nginx-module-0.37rc2
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.15
* iconv-nginx-module-0.10rc4
* lua-5.1.4
* lua-cjson-1.0.2
* lua-rds-parser-0.03
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.12
* nginx-1.0.5
* ngx_devel_kit-0.2.17
* ngx_lua-0.3.0
* ngx_postgres-0.9rc1
* rds-csv-nginx-module-0.02
* rds-json-nginx-module-0.12rc2
* redis2-nginx-module-0.07
* set-misc-nginx-module-0.22rc2
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.5.1rc14 - 2 September 2011
* upgraded LuaNginxModule to v0.2.1rc22.
** fixed an issue with {{{header_filter_by_lua}}} directive: it was not supported in scopes other than the location scope.
! Mainline Version 1.0.5.1rc13 - 1 September 2011
* upgraded LuaNginxModule to 0.2.1rc21.
** added the {{{header_filter_by_lua}}} and {{{header_filter_by_lua_file}}} directives: http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua
** fixed issues with HTTP 1.0 HEAD requests.
* upgraded EchoNginxModule to 0.37rc2
** fixed issues when errors happen in a downstream output filter.
** fixed issues with HTTP HEAD requests.
! Mainline Version 1.0.5.1rc12 - 31 August 2011
* now we bundle LuaRdsParserLibrary and enable it by default.
* added the {{{--without-lua_rds_parser}}} option to disable the LuaRdsParserLibrary bundled.
* now we bundle RdsCsvNginxModule and enable it by default.
* added the {{{--without-http_rds_csv_module}}} option to disable RdsCsvNginxModule.
! Mainline Version 1.0.5.1rc11 - 30 August 2011
* upgraded RdsJsonNginxModule to v0.12rc2
** fixed a bug in compact JSON mode: the column name in the resultset might not be escaped for JSON encoding.
! Mainline Version 1.0.5.1rc10 - 29 August 2011
* upgraded LuaRedisParserLibrary to 0.09rc5.
** added wiki documentation page for this Lua library: http://wiki.nginx.org/LuaRedisParser
** added the {{{typename}}} method for converting the numeric type values returned by {{{parse_reply}}} and {{{parse_replies}}} to textual type names: http://wiki.nginx.org/LuaRedisParser#typename
! Mainline Version 1.0.5.1rc9 - 27 August 2011
* upgraded LuaNginxModule to v0.2.1rc19.
** implemented the {{{o}}} regex option (i.e., the compile-once flag as Perl's {{{/o}}} modifier) for all the {{{ngx.re.*}}} API.
** added new directive {{{lua_regex_cache_max_entries}}} to control the upper limit of the worker-process-level compiled-regex cache enabled by the {{{o}}} regex option: http://wiki.nginx.org/HttpLuaModule#lua_regex_cache_max_entries
** now we add {{{ngx}}} and {{{ndk}}} table into {{{package.loaded}}} such that the user can write {{{local ngx = require 'ngx'}}} and {{{local ndk = require 'ndk'}}}. thanks @Lance.
! Mainline Version 1.0.5.1rc8 - 26 August 2011
* upgraded LuaNginxModule to v0.2.1rc18.
** fixed a bug in the {{{ngx.re.*}}} regex API that look-behind assertions in PCRE regexes did not work properly.
! Mainline Version 1.0.5.1rc7 - 26 August 2011
* upgraded LuaNginxModule to v0.2.1rc17.
** now we enable {{{ngx.re.*}}} regex API in {{{set_by_lua*}}} too.
! Mainline Version 1.0.5.1rc6 - 25 August 2011
* upgraded LuaNginxModule to v0.2.1rc16.
** fixed github issue #52: compile error with nginx 1.0.5 on Ubuntu natty.
** fixed issues found by gcc 4.6 {{{-Wunused-but-set-variable}}} warnings.
! Mainline Version 1.0.5.1rc5 - 24 August 2011
* upgraded LuaNginxModule to v0.2.1rc15.
** implemented the {{{ngx.re.gsub()}}} regex API for Lua: http://wiki.nginx.org/NginxHttpLuaModule#ngx.re.gsub
! Mainline Version 1.0.5.1rc4 - 24 August 2011
* upgraded LuaNginxModule to v0.2.1rc14.
** added support for the optional {{{ctx}}} argument to {{{ngx.re.match}}}.
! Mainline Version 1.0.5.1rc3 - 24 August 2011
* upgraded LuaNginxModule to v0.2.1rc13.
** implemented the {{{ngx.re.sub()}}} regex API for Lua: http://wiki.nginx.org/NginxHttpLuaModule#ngx.re.sub
** added support for anchored match modifier {{{a}}} to {{{ngx.re.match}}}, {{{ngx.re.gmatch}}}, and {{{ngx.re.sub}}}.
* upgraded DrizzleNginxModule to v0.1.1rc4
** added new wiki documentation page: http://wiki.nginx.org/NginxHttpDrizzleModule
** documented the {{{$drizzle_thread_id}}} variable.
** added lots of debug outputs (enabled by the {{{--with-debug}}} option while building Nginx or OpenResty), inspired by github issue #10.
! Mainline Version 1.0.5.1rc2 - 18 August 2011
* upgraded LuaNginxModule to v0.2.1rc12.
** implemented the {{{ngx.re.gmatch()}}} regex API for Lua: http://wiki.nginx.org/NginxHttpLuaModule#ngx.re.gmatch
! Mainline Version 1.0.5.1rc1 - 17 August 2011
* upgraded LuaNginxModule to v0.2.1rc11.
** now {{{ngx.ctx = {...} }}} assignment is supported.
** made setting {{{ngx.header.HEADER}}} after sending out response headers throw out a Lua exception to help debugging issues like github issue #49. thanks Bill Donahue (ikhoyo).
** implemented the {{{ngx.re.match()}}} regex API for Lua: http://wiki.nginx.org/NginxHttpLuaModule#ngx.re.match
! Stable Release 1.0.5.0 - 16 August 2011
This release is the same as 1.0.5.0rc7.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1rc3
* echo-nginx-module-0.37rc1
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.15
* iconv-nginx-module-0.10rc4
* lua-5.1.4
* lua-cjson-1.0.2
* lua-redis-parser-0.09rc4
* memc-nginx-module-0.12
* nginx-1.0.5
* ngx_devel_kit-0.2.17
* ngx_lua-0.2.1rc9
* ngx_postgres-0.9rc1
* rds-json-nginx-module-0.12rc1
* redis2-nginx-module-0.07
* set-misc-nginx-module-0.22rc2
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.5.0rc7 - 13 August 2011
* upgraded LuaNginxModule to v0.2.1rc9.
** implemented the special {{{ngx.ctx}}} Lua table for user programmers to store per-request Lua context data for their applications. thanks 欧远宁 for suggesting this feature.
! Mainline Version 1.0.5.0rc6 - 12 August 2011
* upgraded LuaNginxModule to v0.2.1rc8.
** now {{{ngx.print}}} and {{{ngx.say}}} allow (nested) array-like table arguments. the array elements in them will be sent piece by piece. this will avoid string concatenation for templating engines like [[ltp|http://www.savarese.com/software/ltp/]].
! Mainline Version 1.0.5.0rc5 - 12 August 2011
* upgraded LuaNginxModule to v0.2.1rc7.
** implemented the {{{ngx.req.get_post_args()}}} method for fetching urlencoded POST query arguments from within Lua.
** renamed {{{ngx.req.get_query_args}}} to {{{ngx.req.get_uri_args}}}. the former is now deprecated.
** fixed a bug in {{{ngx.req.get_uri_args}}}: it could not be used more than once in a single request.
! Mainline Version 1.0.5.0rc4 - 12 August 2011
* upgraded LuaNginxModule to v0.2.1rc5.
** implemented the {{{ngx.req.get_query_args()}}} method to fetch parsed URL query arguments from within Lua. thanks Bertrand Mansion (golgote).
** now we allow Lua boolean and {{{nil}}} values in arguments to {{{ngx.say()}}}, {{{ngx.print()}}}, {{{ngx.log()}}} and {{{print()}}}.
! Mainline Version 1.0.5.0rc3 - 11 August 2011
* now we bundle the LuaRedisParserLibrary with us and it is enabled by default. tested on Linux i386, Linux x86_64, Mac OS X, ~FreeBSD 8.2 i386, and Solaris 11.
* added the new option {{{--without-lua_redis_parser}}} to the {{{./configure}}} script.
! Mainline Version 1.0.5.0rc2 - 10 August 2011
* now we bundle the LuaCjsonLibrary with us and it is enabled by default. tested on Linux i386, Linux x86_64, Mac OS X, ~FreeBSD 8.2 i386, and Solaris 11.
* added the new option {{{--without-lua_cjson}}} to the {{{./configure}}} script.
* added {{{<prefix>/lualib}}} to the default {{{path}}} and {{{cpath}}} settings of the ngx_lua's Lua VM.
! Mainline Version 1.0.5.0rc1 - 9 August 2011
* based on ngx_openresty 1.0.4.2, but with nginx core upgraded to nginx 1.0.5.

See [[ChangeLog1000004]] for change log for ngx_openresty 1.0.4.x.
<<toolbar permalink>>
! Stable Release 1.0.6.22 - 7 October 2011
This release is exactly the same as the devel release 1.0.6.21.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1
* echo-nginx-module-0.37rc4
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.16rc2
* iconv-nginx-module-0.10rc4
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.03
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.12
* nginx-1.0.6
* ngx_devel_kit-0.2.17
* ngx_lua-0.3.1rc8
* ngx_postgres-0.9rc1
* rds-csv-nginx-module-0.03
* rds-json-nginx-module-0.12rc5
* redis2-nginx-module-0.07
* set-misc-nginx-module-0.22rc2
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.6.21 - 23 September 2011
* added new option {{{-jN}}} (e.g., {{{-j8}}}, {{{-j10}}}, and etc.) to OpenResty's {{{./configure}}} script to allow parallel build of the dependencies like LuaJIT; thanks @Lance.
! Mainline Version 1.0.6.19 - 23 September 2011
* upgraded LuaNginxModule to v0.3.1rc8.
** exposes the {{{CRC-32}}} API of the Nginx core to the Lua land, in the form of the {{{ngx.crc32_short}}} and {{{ngx.crc32_long}}} methods. thanks @Lance.
! Mainline Version 1.0.6.17 - 23 September 2011
* upgraded LuaNginxModule to v0.3.1rc7.
** now {{{ngx.exec()}}} supports lua table as the second {{{args}}} argument value. thanks sexybabes.
** implemented the {{{ngx.headers_sent}}} API to check if response headers are sent (by ngx_lua). thanks @hugozhu.
! Mainline Version 1.0.6.15 - 22 September 2011
* upgraded LuaNginxModule to v0.3.1rc5.
** now we also return the {{{Last-Modified}}} header (if any) for the subrequest response object. thanks @cyberty and sexybabes.
! Mainline Version 1.0.6.13 - 21 September 2011
* upgraded LuaNginxModule to v0.3.1rc4.
** fixed an issue in {{{ngx.redirect}}}, {{{ngx.exit}}}, and {{{ngx.exec}}}: these function calls would be intercepted by Lua {{{pcall}}}/{{{xpcall}}} because they used lua exceptions; now they use lua yield just as {{{ngx.location.capture}}}. thanks @hugozhu for reporting this.
! Stable Release 1.0.6.12 - 21 September 2011
This release is exactly the same as the devel release 1.0.6.11.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.1
* echo-nginx-module-0.37rc4
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.16rc2
* iconv-nginx-module-0.10rc4
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.03
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.12
* nginx-1.0.6
* ngx_devel_kit-0.2.17
* ngx_lua-0.3.1rc3
* ngx_postgres-0.9rc1
* rds-csv-nginx-module-0.03
* rds-json-nginx-module-0.12rc5
* redis2-nginx-module-0.07
* set-misc-nginx-module-0.22rc2
* srcache-nginx-module-0.12
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.6.11 - 20 September 2011
* upgraded RdsJsonNginxModule to v0.12rc4.
** made {{{rds_json_ret}}} honor {{{rds_json_success_property}}} and {{{rds_json_user_property}}}. thanks Liseen Wan (万珣新)
** only register our output filters when the {{{rds_json}}} directive is actually used in {{{nginx.conf}}}.
* upgraded RdsCsvNginxModule to v0.03.
** only register our output filters when the {{{rds_csv}}} directive is actually used in {{{nginx.conf}}}.
! Mainline Version 1.0.6.9 - 19 September 2011
* upgraded LuaCjsonLibrary to v1.0.3.
! Mainline Version 1.0.6.7 - 18 September 2011
* added new options {{{--with-luajit=PATH}}} and {{{--with-lua51=PATH}}} to the {{{./configure}}} script. thanks ~NginxUser.
* upgraded DrizzleNginxModule to v0.1.1.
! Mainline Version 1.0.6.5 - 15 September 2011
* upgraded RdsJsonNginxModule to 0.12rc3.
** implemented new directive {{{rds_json_root}}}.
** implemented new directive {{{rds_json_success_property}}}.
** implemented new directive {{{rds_json_user_property}}}.
! Mainline Version 1.0.6.3 - 14 September 2011
* upgraded LuaNginxModule to 0.3.1rc3.
** implemented and documented the API for reading response headers from within Lua: {{{value = ngx.header.HEADER}}}.
** fixed a bug when setting a multi-value response header to a single value (via writing to {{{ngx.header.HEADER}}}): the single value will be repeated on each old value.
* upgraded EchoNginxModule to 0.37rc4.
** fixed a bug in {{{echo_after_body}}}: when network is not perfect, data truncation might occur. we should have taken into account {{{NGX_AGAIN}}} returned by the downstream output filters. thanks Sparsh Gupta.
* upgraded HeadersMoreNginxModule to v0.16rc2.
** fixed a bug when setting a multi-value response header to a single value: the single value will be repeated on each old value.
* applied the patch from Maxim Dounin to fix a bug in the standard ngx_gzip module when dealing with empty flush buffers: http://mailman.nginx.org/pipermail/nginx-devel/2011-February/000730.html
* updated the no-pool-patch to eliminate the {{{-Wset-but-not-used}}} warnings issued by gcc 4.6.0.
! Mainline Version 1.0.6.1 - 8 September 2011
* upgraded LuaNginxModule to 0.3.1rc1.
** fixed a bug when the both the main request and the subrequest are POST requests with a body: we should not forward the main request's {{{Content-Length}}} headers to the user subrequests. thanks 朱峰.
! Mainline Version 1.0.6.0rc2 - 4 September 2011
* upgraded HeadersMoreNginxModule to 0.16rc1.
** fixed on-demand hander/filter registration trick for {{{HUP}}} signal restarts.
** added some debugging outputs that can be enabled by the {{{--with-debug}}} option when building Nginx or OpenResty.
! Mainline Version 1.0.6.0rc1 - 4 September 2011
* based on ngx_openresty 1.0.5.1, but with nginx core upgraded to nginx 1.0.6.

See [[ChangeLog1000005]] for change log for ngx_openresty 1.0.5.x.
<<toolbar permalink>>
! Stable Release 1.0.8.26 - 3 November 2011
* now we require {{{gmake}}} ({{{Gnu make}}}) for {{{*BSD}}} systems even if LuaJIT is not enabled. thanks [[@lhmwzy|http://weibo.com/lhmwzy]].
* upgraded the official [[hotfix patch #4|http://www.lua.org/ftp/patch-lua-5.1.4-4]] for the standard Lua 5.1.4 interpreter.
Components bundled in this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc2
* echo-nginx-module-0.37rc7
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.16rc3
* iconv-nginx-module-0.10rc5
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.03
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.13rc1
* nginx-1.0.8
* ngx_devel_kit-0.2.17
* ngx_lua-0.3.1rc23
* ngx_postgres-0.9rc1
* rds-csv-nginx-module-0.04
* rds-json-nginx-module-0.12rc6
* redis2-nginx-module-0.08rc1
* set-misc-nginx-module-0.22rc3
* srcache-nginx-module-0.13rc2
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 1.0.8.25 - 27 October 2011
* upgraded LuaNginxModule to 0.3.1rc23.
** bugfix: {{{ndk.set_var.DIRECTIVE}}} had a memory issue and might pass empty argument values to the directive being called. thanks dannynoonan.
! Mainline Version 1.0.8.23 - 27 October 2011
* upgraded LuaNginxModule to 0.3.1rc22.
** feature: implemented new methods {{{add}}}, {{{replace}}}, {{{incr}}}, and {{{delete}}} for {{{ngx.shared.DICT}}}.
** bugfix: made the {{{set}}} method of {{{ngx.shared.DICT}}} return 3 values: {{{success}}}, {{{err}}}, and {{{forcible}}}.
** bugfix: fixed spots of {{{-Werror=unused-but-set-variable}}} warning issued by gcc 4.6.0.
! Mainline Version 1.0.8.21 - 26 October 2011
* upgraded LuaNginxModule to 0.3.1rc21.
** feature: added new directive {{{lua_shared_dict}}}: http://wiki.nginx.org/HttpLuaModule#lua_shared_dict
** feature: added Lua API for the shm-based dictionary: http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT
* upgraded EchoNginxModule to 0.37rc7.
** bugfix: fixed a memory issue in both {{{echo_sleep}}} and {{{echo_blocking_sleep}}}: we should not pass {{{ngx_str_t}}} strings to {{{atof()}}} which expects C strings.
! Mainline Version 1.0.8.19 - 24 October 2011
* upgraded LuaNginxModule to 0.3.1rc20.
** bugfix: no longer free request body buffers that are not allocated by ourselves.
** bugfix: now we allow setting {{{ngx.var.VARIABLE}}} to {{{nil}}}.
! Mainline Version 1.0.8.17 - 22 October 2011
* upgraded LuaNginxModule to 0.3.1rc19.
** feature: now we apply the patch to the nginx core so as to allow main request body modifications: https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.8-allow_request_body_updating.patch
** feature: added new Lua API {{{ngx.req.set_body_file()}}}: http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_file
** feature: added new Lua API {{{ngx.req.set_body_data()}}}: http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_data
** bugfix: {{{lua_need_request_body}}} should not skip requests with methods other than {{{POST}}} and {{{PUT}}}. thanks Nginx User.
! Mainline Version 1.0.8.15 - 19 October 2011
* upgraded LuaNginxModule to 0.3.1rc17.
** feature: added new Lua functions {{{ngx.req.read_body()}}}, {{{ngx.req.discard_body()}}}, {{{ngx.req.get_body_data()}}}, and {{{ngx.req.get_body_file()}}}. see the docs here: http://wiki.nginx.org/HttpLuaModule#ngx.req.read_body
** bugfix: fixed hanging issues when using {{{ngx.exec()}}} within {{{rewrite_by_lua}}} and {{{access_by_lua}}}. thanks Nginx User for reporting it.
! Mainline Version 1.0.8.13 - 16 October 2011
* upgraded LuaNginxModule to 0.3.1rc16.
** fixed compilation failures when {{{--with-debug}}} is turned off.
** now we prohibit use of {{{true}}} jump argument in {{{ngx.req.set_uri()}}} in contexts other than {{{rewrite_by_lua}}} and {{{rewrite_by_lua_file}}}. a lua exception will be thrown if the context is incorrect.
! Mainline Version 1.0.8.11 - 16 October 2011
* upgraded LuaNginxModule to 0.3.1rc14.
** now we change the {{{ngx.req.set_uri()}}} API a bit by changing the optional argument {{{break_cycle}}} to {{{jump}}}. so now it will not trigger location jump by default (because the {{{jump}}} argument is false by default) and in case {{{jump}}} is given true, the function will re-search locations and jump to the new location and never return.
! Mainline Version 1.0.8.9 - 16 October 2011
* upgraded LuaNginxModule to 0.3.1rc13.
** now we implemented {{{ngx.req.set_uri()}}} and {{{ngx.req.set_uri_args()}}} to emulate {{{ngx_rewrite}}}'s {{{rewrite}}} directive (without {{{redirect}}} or {{{permanent}}} modifiers). thanks Vladimir Protasov (utros) and Nginx User.
** now we skip rewrite phase Lua handlers altogether if {{{ngx_rewrite}}}'s {{{rewrite}}} directive issue a location re-lookup by changing ~URIs (but not including rewrite ... break). thanks Nginx User.
** added constant {{{ngx.HTTP_METHOD_NOT_IMPLEMENTED}}} (501). thanks Nginx User.
! Mainline Version 1.0.8.7 - 15 October 2011
* upgraded SrcacheNginxModule to 0.13rc2.
** bugfix: we now only cache 200, 301, and 302 responses by default.
** feature: implemented new directive {{{srcache_store_statuses}}} to allow the user to specify the response status code list that is to be stored into the cache.
! Mainline Version 1.0.8.5 - 13 October 2011
* upgraded LuaNginxModule to 0.3.1rc11.
** bugfix: now we explicitly clear all the modules' contexts before dump to named location with {{{ngx.exec}}}.
* upgraded EchoNginxModule to 0.37rc6.
** bugfix: now we explicitly clear all the modules' contexts before dump to named location with {{{echo_exec}}}.
** bugfix: bugfix: {{{echo_exec}}} may hang when running after {{{echo_sleep}}} (or other I/O interruption calls): we should have called {{{ngx_http_finalize_request}}} on {{{NGX_DONE}}} to decrement {{{r->main->count}}} anyway.
* applied the patch to the Nginx core that always clears all modules' contexts in {{{ngx_http_named_location}}}.
! Mainline Version 1.0.8.3 - 13 October 2011
* upgraded LuaNginxModule to 0.3.1rc10.
** bugfix: calling {{{ngx.exec()}}} to jump to a named location did not clear the context object of LuaNginxModule properly and might cause evil problems. thanks Nginx User.
* upgraded IconvNginxModule to 0.10rc5.
** bugfix: fixed {{{-Wset-but-not-used}}} warnings issued by gcc 4.6.0. thanks 支家乐 (Calio).
! Mainline Version 1.0.8.1 - 10 October 2011
* upgraded EchoNginxModule to 0.37rc5.
** bugfix: now we properly set the {{{Content-Length}}} request header for subrequests.
* upgraded LuaNginxModule to 0.3.1rc9.
** feature: now for HTTP 1.0 requests, we disable the automatic full buffering mode if the user sets the {{{Content-Length}}} response header before sending out the headers. this allows streaming output for HTTP 1.0 requests if the content length can be calculated beforehand. thanks 李子义.
** bugfix: now we properly support setting the {{{Cache-Control}}} response header via the {{{ngx.header.HEADER}}} interface.
** bugfix: no longer set header hash to 1. use the {{{ngx_hash_key_lc}}} instead.
* upgraded HeadersMoreNginxModule to 0.16rc3.
** bugfix: we should set header hash using {{{ngx_hash_key_lc}}}, not simply to 1.
** bugfix: fixed setting {{{Cache-Control}}} response headers. we should properly prepare the {{{r->cache_control}}} array as well.
* upgraded SrcacheNginxModule to 0.13rc1.
** implemented response status line and general response header caching and added new directives {{{srcache_store_hide_header}}} and {{{srcache_store_pass_header}}} to control which headers to cache and which not.
** added new directive {{{srcache_response_cache_control}}} to control whether honor response headers {{{Cache-Control}}} and {{{Expires}}}, default {{{on}}}.
** we disable {{{srcache_store}}} automatically by default when {{{Cache-Control: max-age=0}}} and {{{Expires: <date no more recently than now>}}} are seen.
** implemented builtin nginx variable {{{$srcache_expire}}} for automatic expiration time calculation based on response headers {{{Cache-Control}}} ({{{max-age}}}) and {{{Expires}}}; also added new directives {{{srcache_max_expire}}} and {{{srcache_default_expire}}}.
** implemented the {{{srcache_store_no_cache}}} directive; now by default, we do not store responses with the header {{{Cache-Control: no-cache}}} into the cache.
** implemented {{{the srcache_store_no_store directive}}} (default {{{off}}}). Now by default, responses with the header {{{Cache-Control: no-store}}} will not be stored into the cache.
** implemented the {{{srcache_store_private}}} directive to control whether to store responses with the header {{{Cache-Control: private}}}.
** implemented the {{{srcache_request_cache_control}}} directive to allow request headers {{{Cache-Control: no-cache}}} or {{{Pragma: no-cache}}} to force bypassing cache lookup. it also honors the request header {{{Cache-Control: no-store}}}. this directive is turned off by default.
** now we check response header {{{Content-Encoding}}} by default and a non-empty header value will {{{skip srcache_store}}}; also introduced a new directive named {{{srcache_ignore_content_encoding}}} to ignore this response header.
** implemented the {{{srcache_methods}}} directive to specify request methods that are cacheable, by default, only {{{GET}}} and {{{HEAD}}} are cacheable.
** bugfix: we no longer set header hash to 1; we use {{{ngx_hash_key_lc}}} instead.
** bugfix: when we skip {{{srcache_fetch}}} by means of {{{srcache_fetch_skip}}}, we should not automatically skip {{{srcache_store}}}.
** bugfix: now we ignore the {{{Content-Length}}} header (if any) of the main request for the subrequests.
** bugfix: there might be a segfault when failing to allocate memory in {{{ngx_http_srcache_add_copy_chain}}}. thanks Shaun savage.
* upgraded RdsJsonNginxModule to 0.12rc6.
** bugfix: fixed compatibility with nginx 1.1.4+.
* upgraded RdsCsvNginxModule to 0.04.
** bugfix: fixed compatibility issues with nginx 1.1.4+.
** optimization: now we only register our filters when {{{rds_csv}}} is actually used in {{{nginx.conf}}}.
* upgraded Redis2NginxModule to 0.08rc1.
** bugfix: fixed compatibility with nginx 1.1.4+.
* upgraded DrizzleNginxModule to 0.1.2rc2.
** bugfix: fixed compatibility with nginx 1.1.4+
* upgraded MemcNginxModule to 0.13rc1.
** bugfix: fixed compatibility with nginx 1.1.4+.
* upgraded SetMiscNginxModule to v0.22rc3.
** minor code cleanup.
* applied the patch for the variable-header-ignore-no-hash issue. see http://forum.nginx.org/read.php?29,216062 for details.
* based on OpenResty 1.0.6.22 and upgraded the Nginx core to 1.0.8.

See [[ChangeLog1000006]] for change log for ngx_openresty 1.0.6.x.
<<toolbar permalink>>
! Stable Release 1.0.9.10 - 16 November 2011
* bugfix: fixed the error message length while the {{{./configure}}} script fails.

Components bundled in this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc4
* echo-nginx-module-0.37rc7
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.16rc4
* iconv-nginx-module-0.10rc5
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.04
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.13rc1
* nginx-1.0.9
* ngx_devel_kit-0.2.17
* ngx_lua-0.3.1rc28
* ngx_postgres-0.9rc2
* rds-csv-nginx-module-0.04
* rds-json-nginx-module-0.12rc6
* redis2-nginx-module-0.08rc1
* set-misc-nginx-module-0.22rc3
* srcache-nginx-module-0.13rc2
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc5
! Mainline Version 1.0.9.9 - 13 November 2011
* upgraded DrizzleNginxModule to 0.1.2rc4.
** bugfix: it might prematurly remove a write event when still busily connecting to the database from the event model.
! Mainline Version 1.0.9.7 - 10 November 2011
* applied [[a patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.9-log_escape_non_ascii.patch]] to add new directives {{{log_escape_non_ascii}}} to prevent escaping non-ascii bytes in access log variable values. requested by [[@姜大炮|http://weibo.com/egis]]. It can be turned {{{on}}} and {{{off}}}, and default to {{{on}}} just as the standard Nginx version.
! Mainline Version 1.0.9.5 - 9 November 2011
* upgraded LuaNginxModule to 0.3.1rc28.
** bugfix: {{{Cache-Control}}} header modification might introduce empty value headers when using with the standard [[ngx_headers|http://wiki.nginx.org/HttpHeadersModule]] module.
* upgraded HeadersMoreNginxModule to 0.16rc4.
** bugfix: {{{Cache-Control}}} header modification might introduce empty value headers when using with the standard [[ngx_headers|http://wiki.nginx.org/HttpHeadersModule]] module.
! Mainline Version 1.0.9.3 - 9 November 2011
* upgraded LuaNginxModule to 0.3.1rc27.
** feature: added the [[ngx.encode_args|http://wiki.nginx.org/HttpLuaModule#ngx.encode_args]] method to encode a Lua code to a URI query string. thanks 郭颖 ([[0597虾|http://weibo.com/shrimp0597]]).
** feature: [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and [[ngx.exec|http://wiki.nginx.org/HttpLuaModule#ngx.exec]] now supports the same Lua args table format as in [[ngx.encode_args|http://wiki.nginx.org/HttpLuaModule#ngx.encode_args]]. thanks 郭颖 ([[0597虾|http://weibo.com/shrimp0597]]).
* upgraded DrizzleNginxModule to 0.1.2rc3.
** bugfix: fixed issues with {{{poll}}}, {{{rtsig}}}, and {{{select}}} used by the Nginx event model by eliminating the {{{poll}}} syscall performed by {{{libdrizzle}}}. This also gives rise to a nice speedup (about 10% in simple cases).
* bugfix: [[nginx-1.0.9-variable_header_ignore_no_hash.patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.9-variable_header_ignore_no_hash.patch]] might introduce a memory overflow issue in multi-header variables. thanks Markus Linnala.
! Mainline Version 1.0.9.1 - 8 November 2011
* upgraded the Nginx core to 1.0.9.
* applied the [[epoll_check_stale_wev patch|http://mailman.nginx.org/pipermail/nginx-devel/2011-November/001408.html]] to the Nginx 1.0.9 core. thanks [[@晓旭XX|http://weibo.com/u/1878897190]].
* upgraded LuaNginxModule to 0.3.1rc26.
** feature: added the {{{ctx}}} option to [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]]: you can now specify a custom Lua table to pass to the subrequest as its [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]]. thanks [[@hugozhu|http://weibo.com/hugozhu]].
** bugfix: fixed compatibility with nginx 0.8.54. thanks [[@0579虾|http://weibo.com/shrimp0597]].
* upgraded PostgresNginxModule to 0.9rc2
** bugfix: now we log an error message when the {{{postgres_pass}}} target is not found at all and returns 500 in this case instead of returning empty response.
**  bugfix: we should no longer return {{{NGX_AGAIN}}} when the re-polling returns IO WAIT in case of the "connection made" state.
** feature: added some debugging outputs which be enabled by passing the {{{--with-debug}}} option while building Nginx or OpenResty.
** bugfix: fixed compatibility issues with Nginx 1.1.4+: {{{ngx_chain_update_chains}}} now requires a pool argument.
* upgraded LuaRdsParserLibrary to 0.04.
** bugfix: fixed a serious memory leak reported by bearnard.
* upgraded XssNginxModule to 0.03rc5.
** bugfix: the callback argument value parser did not accept ~JavaScript identifier names started with underscores. thanks Sam Mulube.
See [[ChangeLog1000008]] for change log for ngx_openresty 1.0.8.x.
<<toolbar permalink>>
! Stable Release 1.0.10.48 - 1 February 2012
* upgraded LuaNginxModule to 0.4.1.
Components bundled with this release:
* ~LuaJIT-2.0.0-beta9
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc6
* echo-nginx-module-0.38rc1
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.17rc1
* iconv-nginx-module-0.10rc5
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.04
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.13rc3
* nginx-1.0.10
* ngx_devel_kit-0.2.17
* ngx_lua-0.4.1
* ngx_postgres-0.9rc2
* rds-csv-nginx-module-0.04
* rds-json-nginx-module-0.12rc7
* redis2-nginx-module-0.08rc2
* set-misc-nginx-module-0.22rc5
* srcache-nginx-module-0.13rc3
* upstream-keepalive-nginx-module-0.7
* xss-nginx-module-0.03rc8
! Mainline Version 1.0.10.47 - 29 January 2012
* upgraded LuaNginxModule to 0.4.1rc4.
** bugfix: {{{ngx_http_lua_header_filter_init}}} was called with an argument which actually accepts none. this could cause compilation errors at least with gcc 4.3.4 as reported in github [[issue #80|http://github.com/chaoslawful/lua-nginx-module/issues/80]]. thanks bigplum (Simon).
! Mainline Version 1.0.10.45 - 19 January 2012
* upgraded LuaNginxModule to 0.4.1rc3.
** bugfix: fixed all the warnings from the {{{clang}}} static analyzer.
** bugfix: [[ngx.exit|http://wiki.nginx.org/HttpLuaModule#ngx.exit]], [[ngx.redirect|http://wiki.nginx.org/HttpLuaModule#ngx.redirect]], [[ngx.exec|http://wiki.nginx.org/HttpLuaModule#ngx.exec]], and [[ngx.req.set_uri(uri, true)|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri]] could return (they should never return as per the documentation). this bug had appeared in ngx_lua v0.3.1rc4 and ngx_openresty 1.0.6.13. thanks [[@cyberty|http://weibo.com/cyberty]] for reporting it.
** feature: allow use of the {{{DDEBUG}}} macro from the outside (via the {{{-D DDEBUG=1}}} cc opton).
* upgraded DrizzleNginxModule to v0.1.2rc6.
** bugfix: fixed all the warnings from the {{{clang}}} static analyzer.
** feature: allow use of the {{{DDEBUG}}} macro from the outside (via the {{{-D DDEBUG=1}}} cc opton).
* upgraded EchoNginxModule to 0.38rc1, SetMiscNginxModule to 0.22rc5, HeadersMoreNginxModule to 0.17rc1, and MemcNginxModule to 0.13rc3, to allow use of the {{{DDEBUG}}} macro from the outside (via the {{{-D DDEBUG=1}}} cc opton).
! Stable Release 1.0.10.44 - 16 January 2012
* upgraded EchoNginxModule to 0.37.
* upgraded HeadersMoreNginxModule to 0.16.
* bugfix: fixed compatibility of the packaging scripts on Darwin and *BSD. thanks nightsailer and Piotr Sikora.
Components bundled with this release:
* ~LuaJIT-2.0.0-beta9
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc4
* echo-nginx-module-0.37
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.16
* iconv-nginx-module-0.10rc5
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.04
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.13rc2
* nginx-1.0.10
* ngx_devel_kit-0.2.17
* ngx_lua-0.4.0
* ngx_postgres-0.9rc2
* rds-csv-nginx-module-0.04
* rds-json-nginx-module-0.12rc7
* redis2-nginx-module-0.08rc2
* set-misc-nginx-module-0.22rc4
* srcache-nginx-module-0.13rc3
* upstream-keepalive-nginx-module-0.7
* xss-nginx-module-0.03rc8
! Mainline Version 1.0.10.43 - 12 January 2012
* upgraded LuaNginxModule to 0.4.0.
* upgraded EncryptedSessionNginxModule to 0.02.
** bugfix: the {{{-lssl}}} option broke nginx linking when {{{--with-openssl=DIR}}} is specified. thanks charlieyang for reporting this issue.
* bugfix: fixed issues with relative path DIR in the {{{--with-openssl=DIR}}} option for {{{./configure}}}.
! Mainline Version 1.0.10.41 - 9 January 2012
* upgraded UpstreamKeepaliveNginxModule to 0.7.
** Bugfix: unbuffered connection might not be kept alive under Linux.
** Bugfix: module could not be built on Windows.
** Bugfix: module could not be built without the ngx_http_ssl_module.
** Feature: https connections support (requires patches).
** Bugfix: invalid connections might be cached.
** Bugfix: the "[alert] ... open socket ... left in connection ..." messages were logged on nginx worker process gracefull exit for each cached connection; the bug had appeared in version 0.3.
* upgraded EchoNginxModule to 0.37rc8.
** bugfix: fixed two spots that we did not check null pointers returned by the memory allocator.
** bugfix: attempt to fix places where {{{ngx_time_update}}} might not be compiled properly.
! Mainline Version 1.0.10.39 - 4 January 2012
* upgraded LuaNginxModule to v0.3.1rc45.
** bugfix: [[ngx.req.get_uri_args|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_uri_args]] and [[ngx.req.get_post_args|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_post_args]] now only parse up to 100 arguments by default. but one can specify the optional argument to these two methods to specify a custom maximum number of args. thanks Tzury Bar Yochay for reporting this.
** bugfix:  [[ngx.req.get_headers|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers]] now only parse up to 100 request headers by default. but one can specify the optional argument to this method to specify a custom maximum number of headers.
! Mainline Version 1.0.10.37 - 30 December 2011
* upgraded LuaNginxModule to v0.3.1rc43.
** bugfix: removing builtin headers via [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] and its equivalent in huge request headers with 20+ entries could result in data loss. thanks Chris Dumoulin for the patch in [[github issue #6|https://github.com/agentzh/headers-more-nginx-module/issues/6]].
** bugfix: could not compile with Nginx 1.1.12+ because Nginx 1.1.12 changed its regex API. now we call PCRE API directly and require at least PCRE 8.21 for the PCRE JIT support in our {{{ngx.re}}} API (since PCRE 8.20 had a bug in its JIT engine that it did not honor {{{pcre_malloc}}} and {{{pcre_free}}} at all).
! Mainline Version 1.0.10.35 - 30 December 2011
* upgraded HeadersMoreNginxModule to v0.16rc7.
** bugfix: removing builtin headers in huge request headers with 20+ entries could result in data loss. thanks Chris Dumoulin for the patch in [[github issue #6|https://github.com/agentzh/headers-more-nginx-module/issues/6]].
* bugfix: the {{{install}}} phony target did not depend on the {{{all}}} phony target in the Makefile generated by {{{./configure}}}. thanks [[姚伟斌|http://weibo.com/yaoweibin]] for reporting this issue.
! Mainline Version 1.0.10.33 - 29 December 2011
* bugfix: the {{{./configure}}} script's  {{{--add-module}}} option did not accept relative path values. thanks [[姚伟斌|http://weibo.com/yaoweibin]] for the patch.
! Mainline Version 1.0.10.31 - 25 December 2011
* upgraded LuaJIT to 2.0.0beta9.
** changes: http://luajit.org/changes.html
* upgraded LuaNginxModule to v0.3.1rc42.
** bugfix: [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] might cause invalid memory reads because Nginx request header values must be null terminated. thanks Maxim Dounin.
** bugfix: {{{ngx.var.VARIABLE}}} might evaluate to nil even if there is a valid value because the Nginx variable value's {{{valid}}} flag might not be initialized properly. this bad had appeared in v0.3.1rc40.
* upgraded HeadersMoreNginxModule to v0.16rc6.
** bugfix: the [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_headers]] directive might cause invalid memory reads because Nginx request header values must be null terminated. thanks Maxim Dounin.
! Mainline Version 1.0.10.29 - 17 December 2011
* upgraded LuaNginxModule to v0.3.1rc41.
** bugfix: [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] and [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not handle the {{{Accept-Encoding}}} request headers properly. thanks 天街夜色.
* upgraded HeadersMoreNginxModule to 0.16rc5.
** bugfix: [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] and [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not handle the {{{Accept-Encoding}}} request headers properly. thanks 天街夜色.
! Mainline Version 1.0.10.27 - 16 December 2011
* upgraded LuaNginxModule to v0.3.1rc40.
** bugfix: {{{ngx.flush(true)}}} could not be used before I/O calls like [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]]. this bug had appeared in v0.3.1rc34.
** bugfix: {{{ngx.var.VARIABLE}}} did not evaluate to {{{nil}}} when the Nginx variable's {{{valid}}} flag is {{{0}}}.
** docs: various documentation improvements. thanks Nginx User.
** bugfix: there were various places where we did not check the pointer returned by the memory allocator.
* upgraded SetMiscNginxModule to v0.22rc4.
** bugfix: fixed one place that does not check the pointer returned by the memory allocator.
** src: converted {{{CRLF}}} in the source files and test files to {{{LF}}}.
* bugfix: some old version of shell {{{cp}}} command does not support trailing slashes in the destination argument and could break our {{{./configure}}} script. thanks [[姚伟斌|http://weibo.com/yaoweibin]] for reporting it.
! Mainline Version 1.0.10.25 - 14 December 2011
* upgraded SrcacheNginxModule to v0.13rc3.
** bugfix: fixed a regression with XssNginxModule for cache hits. this bug had appeared in v0.13rc1. thanks [[万珣新|http://weibo.com/liseen]].
** bugfix: we did not cache the {{{Location}}} response header at all for {{{301}}}/{{{302}}} responses.
** bugfix: we should not blindly cache the {{{Accept-Ranges: bytes}}} response headers regardless of the actual current requests.
* upgraded XssNginxModule to v0.03rc8.
** bugfix: fixed a few debug-level log messages; the old text was misleading.
! Stable Release 1.0.10.24 - 11 December 2011
Same as the devel version 1.0.10.23.

Components bundled with this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc4
* echo-nginx-module-0.37rc7
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.16rc4
* iconv-nginx-module-0.10rc5
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.04
* lua-redis-parser-0.09rc5
* memc-nginx-module-0.13rc2
* nginx-1.0.10
* ngx_devel_kit-0.2.17
* ngx_lua-0.3.1rc38
* ngx_postgres-0.9rc2
* rds-csv-nginx-module-0.04
* rds-json-nginx-module-0.12rc7
* redis2-nginx-module-0.08rc2
* set-misc-nginx-module-0.22rc3
* srcache-nginx-module-0.13rc2
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc7
! Mainline Version 1.0.10.23 - 5 December 2011
* upgraded RdsJsonNginxModule to v0.12rc7.
** added more debug level error log outputs to ease debugging (as discussed in [[github issue #2|https://github.com/agentzh/rds-json-nginx-module/issues/2]]).
* upgraded XssNginxModule to v0.03rc7.
** now we use the {{{ngx_log_debugN}}} macros to emit debugging outputs instead of {{{info}}} level error logging because the latter is costly in production.
* upgraded LuaNginxModule to 0.3.1rc38.
** added constant {{{ngx.HTTP_GATEWAY_TIMEOUT}}} (504) per Fry-kun in [[github issue #73|https://github.com/chaoslawful/lua-nginx-module/issues/73]].
! Mainline Version 1.0.10.21 - 30 November 2011
* fixed a serious regression for Linux AIO in [[nginx-1.0.10-epoll_check_stale_wev.patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.10-epoll_check_stale_wev.patch]], thanks Maxim Dounin for the patch's patch.
! Mainline Version 1.0.10.19 - 29 November 2011
* upgraded LuaNginxModule to 0.3.1rc37.
** bugfix: use of the ngx.re API might lead to errors like {{{pcre_compile() failed: failed to get memory in ...}}} due to incorrect {{{pcre_malloc}}} and {{{pcre_free}}} handling. thanks Vittly for reporting this as [[github issue #72|https://github.com/chaoslawful/lua-nginx-module/issues/72]].
** docs: massive documentation improvements. thanks Nginx User.
! Mainline Version 1.0.10.17 - 26 November 2011
* upgraded LuaNginxModule to 0.3.1rc36.
** bugfix: fixed the {{{ngx_log_debugN}}} macros which failed to compile without {{{--with-debug}}}. thanks [[@ldmiao|http://weibo.com/ldmiao]] for reporting it.
! Mainline Version 1.0.10.15 - 26 November 2011
* upgraded LuaNginxModule to 0.3.1rc35.
** bugfix: now we check timed out downstream connections in our write event handler.
! Mainline Version 1.0.10.13 - 25 November 2011
* upgraded LuaNginxModule to 0.3.1rc34.
** feature: added {{{wait}}} boolean argument to [[ngx.flush()|http://wiki.nginx.org/HttpLuaModule#ngx.flush]] to support synchronous flushing; {{{ngx.flush(true)}}} will not return until all the data has been flushed into the system send buffer or the send timeout has expired.
! Mainline Version 1.0.10.11 - 24 November 2011
* upgraded LuaNginxModule to 0.3.1rc33.
** feature: added new Lua API [[ngx.now|http://wiki.nginx.org/HttpLuaModule#ngx.now]] to return the current time (including the ms part as the decimal part). thanks 林青.
** feature: added new Lua API [[ngx.update_time|http://wiki.nginx.org/HttpLuaModule#ngx.update_time]] to forcibly updating nginx's time cache.
** docs: massive documentation improvement done by Nginx User.
! Mainline Version 1.0.10.9 - 24 November 2011
* upgraded XssNginxModule to 0.03rc6.
** bugfix: now we use {{{signed char}}} explicitly instead of the vague {{{char}}} type which could be unsigned by default in certain systems like ~PowerPC. thanks Dmitry E. Oboukhov.
* upgraded MemcNginxModule to 0.13rc2.
** bugfix: now we use {{{signed char}}} explicitly instead of the vague {{{char}}} type which could be unsigned by default in certain systems like ~PowerPC. thanks Dmitry E. Oboukhov.
* upgraded Redis2NginxModule to 0.08rc2.
** bugfix: when {{{char}}} defaults to {{{unsigned char}}}, the Ragel-based Redis response parser could not accept non-ascci bytes. thanks Dmitry E. Oboukhov.
! Mainline Version 1.0.10.7 - 23 November 2011
* upgraded LuaNginxModule to 0.3.1rc31.
** feature: added opions {{{copy_all_vars}}} and {{{vars}}} to [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]]. thanks Marcus Clyne for the patch.
** bugfix: fixed a bad regression in [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]] when the request option table is specified. this bug had appeared in ngx_lua 0.3.1rc26 and ngx_openresty 1.0.9.1.
! Mainline Version 1.0.10.5 - 21 November 2011
* upgraded LuaNginxModule to 0.3.1rc30.
** feature: added new regex options {{{"j"}}} and {{{"d"}}} to [[ngx.re.match|http://wiki.nginx.org/HttpLuaModule#ngx.re.match]], [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]], [[ngx.re.sub|http://wiki.nginx.org/HttpLuaModule#ngx.re.sub]], and [[ngx.re.gsub|http://wiki.nginx.org/HttpLuaModule#ngx.re.gsub]]  so as to enable the PCRE [[JIT mode|http://www.manpagez.com/man/3/pcrejit/]] and DFA mode, respectively. thanks [[@姜大炮|http://weibo.com/egis]] for providing the patch.
! Mainline Version 1.0.10.3 - 17 November 2011
* upgraded LuaNginxModule to 0.3.1rc29.
** feature: added [[ngx.hmac_sha1|http://wiki.nginx.org/HttpLuaModule#ngx.hmac_sha1]]. thanks [[drdrxp|http://weibo.com/drdrxp]].
** docs: documented the long-existent [[ngx.md5|http://wiki.nginx.org/HttpLuaModule#ngx.md5]] and [[ngx.md5_bin|http://wiki.nginx.org/HttpLuaModule#ngx.md5_bin]] ~APIs.
** docs: massive documentation improvements. thanks Nginx User.
! Mainline Version 1.0.10.1 - 16 November 2011
* upgraded the Nginx core to 1.0.10.

See [[ChangeLog1000009]] for change log for ngx_openresty 1.0.9.x.
<<toolbar permalink>>
! Stable Release 1.0.11.28 - 25 March 2012
Same as the devel release 1.0.11.27.

Components bundled with this release:
* ~LuaJIT-2.0.0-beta9 (hotfix #1)
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc6
* echo-nginx-module-0.38rc2
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.17rc1
* iconv-nginx-module-0.10rc7
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.04
* lua-redis-parser-0.09rc7
* lua-resty-memcached-0.06
* lua-resty-mysql-0.06
* lua-resty-redis-0.08
* lua-resty-string-0.05
* lua-resty-upload-0.02
* memc-nginx-module-0.13rc3
* nginx-1.0.11
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.17
* ngx_lua-0.5.0rc21
* ngx_postgres-0.9
* rds-csv-nginx-module-0.05rc1
* rds-json-nginx-module-0.12rc7
* redis2-nginx-module-0.08rc4
* set-misc-nginx-module-0.22rc5
* srcache-nginx-module-0.13rc6
* upstream-keepalive-nginx-module-0.7
* xss-nginx-module-0.03rc9
! Mainline Version 1.0.11.27 - 22 March 2012
* upgraded LuaNginxModule to 0.5.0rc21.
** bugfix: made the sha1 library (or ~OpenSSL) an optional dependency, as suggested by runner-mei in [[github issue #94|https://github.com/chaoslawful/lua-nginx-module/issues/94]].
** bugfix: we did not declare C variables at the beginning of the current code block in {{{ngx_http_lua_del_thread}}}, reported by runner-mei in [[github issue #93|https://github.com/chaoslawful/lua-nginx-module/issues/93]].
** bugfix: incorrectly used {{{ngx_conf_log_error}}} by feeding {{{NGX_ERROR}}} as the first argument, as reported by runner-mei in [[github issue #92|https://github.com/chaoslawful/lua-nginx-module/issues/92]].
** bugfix: spelling errors in Lua exception message text.
* upgraded EchoNginxModule to 0.38rc2.
** bugfix: [[$echo_request_body|http://wiki.nginx.org/HttpEchoModule#.24echo_request_body]] variable was not able to work on arbitrary request body chains (i.e., more than 2 chain links), just like the standard [[$request_body|http://wiki.nginx.org/HttpCoreModule#.24request_body]] variable that only processes the first two chain links. now [[$echo_request_body|http://wiki.nginx.org/HttpEchoModule#.24echo_request_body]] no longer has this limitation.
* applied the upstream_pipelining patch to the nginx core, as discussed here: http://mailman.nginx.org/pipermail/nginx-devel/2012-March/002040.html this patch is required at least for the pipelined requests support in nginx upstream modules.
! Mainline Version 1.0.11.25 - 16 March 2012
* applied the null-character-fixes patch from the mainstream. The bug did result in a disclosure of previously freed memory if upstream server returned specially crafted response, potentially exposing sensitive information.
* upgraded SrcacheNginxModule to 0.13rc6.
** bugfix: fixed a typo in an error message text for response truncation check in [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]].
! Mainline Version 1.0.11.23 - 15 March 2012
* upgraded LuaNginxModule to 0.5.0rc19.
** feature: added new directive [[lua_http10_buffering|http://wiki.nginx.org/HttpLuaModule#lua_http10_buffering]] which is {{{on}}} by default.
** feature: added new constant {{{ngx.DECLINED}}}.
** bugfix: [[access_by_lua|http://wiki.nginx.org/HttpLuaModule#access_by_lua]] could not work with the {{{satisfy any}}} configuration.
** bugfix: now we recycle the special flush buffer and chain link for [[ngx.flush|http://wiki.nginx.org/HttpLuaModule#ngx.flush]] to prevent request-scoped memory leaks when emitting long data streams to the downstream.
* upgraded SrcacheNginxModule to 0.13rc5.
** feature: now [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]] discards responses that are obviously truncated when the actual output data is shorter than what is declared in its {{{Content-Length}}} response header. thanks Greg Grensteiner.
** bugfix: the access phase handler actually ran in a phase later than the {{{access}}} phase.
** bugfix: HTTP HEAD requests that lead to a cache hits would cause memory issues like invalid reads.
* upgraded LuaRestyRedisLibrary to 0.08.
** feature: implemened redis pipelining API by adding new methods {{{init_pipeline}}}, {{{commit_pipeline}}}, and {{{cancel_pipeline}}}.
! Mainline Version 1.0.11.21 - 7 March 2012
* upgraded LuaRestyRedisLibrary to 0.07.
** feature: added the [[evalsha|http://redis.io/commands/eval]] command to the redis command table. thanks Chris Love.
* upgraded LuaRestyStringLibrary to 0.05.
** feature: added new modules {{{resty.sha224}}}, {{{resty.sha256}}}, {{{resty.sha384}}}, and {{{resty.sha512}}} to exposes the ~OpenSSL API for the complete {{{SHA-2}}} hash function set. thanks @lhmwzy.
* upgraded LuaNginxModule to 0.5.0rc17.
** bugfix: time stamps could overflow on 32-bit systems in the shared dict API; now we explicitly use 64-bit integers.
** feature: added new method {{{flush_all}}} to the shared dict. thanks Weiqiang Li.
** docs: documented the max concurrent subrequest count limitation and max error log line size limit.
! Mainline Version 1.0.11.19 - 1 March 2012
* upgraded Redis2NginxModule to 0.08rc4.
** bugfix: redis "nil multi bulk replies" did not parse at all. thanks 郭颖 for reporting this issue.
* upgraded LuaRedisParserLibrary to 0.09rc7.
** bugfix: redis "nil multi bulk replies" did not parse at all. thanks 郭颖 for reporting this issue.
! Mainline Version 1.0.11.17 - 29 February 2012
* feature: bundle LuaRestyMySQLLibrary 0.06, which is enabled by default.
* feature: bundle LuaRestyRedisLibrary 0.06, which is enabled by default.
* feature: bundle LuaRestyMemcachedLibrary 0.06, which is enabled by default.
* feature: bundle LuaRestyUploadLibrary 0.02, which is enabled by default.
* feature: bundle LuaRestyStringLibrary 0.04, which is enabled by default.
* bugfix: no longer enable {{{-DLUAJIT_USE_VALGRIND}}} for LuaJIT when {{{--with-debug}}} option is specified.
* bugfix: applied the official [[hotfix #1 patch|http://luajit.org/download/beta9_hotfix1.patch]] for LuaJIT 2.0.0 beta9.
* feature: raised the default {{{NGX_HTTP_MAX_SUBREQUESTS}}} to 200, in sync with the official repository.
* upgraded LuaNginxModule to 0.5.0rc16.
** bugfix: the shared dict storage might leak memory in the store: {{{ngx_http_lua_shdict_lookup}}} incorrectly assumed that nodes with identical keys are linked together, which might not be true after tree re-balancing. thanks the patch from Lanshun Zhou.
** optimize: removed a redundant piece of code for subrequest {{{headers_in}}} fixes in {{{ngx_http_lua_adjust_subrequest}}}.
! Mainline Version 1.0.11.15 - 24 February 2012
* now we enable the {{{-DLUAJIT_USE_VALGRIND -DLUA_USE_APICHECK -DLUA_USE_ASSERT}}} flags for LuaJIT when the {{{--with-debug}}} option is specified.
* apply the [[max_subrequests patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.11-max_subrequests.patch]] to allow the {{{NGX_HTTP_MAX_SUBREQUESTS}}} macro to be overridden from the outside and adjusted the default value from 50 to 100 because 50 is a little too conservative.
* upgraded XssNginxModule to 0.03rc9, RdsCsvNginxModule to 0.05rc1, and Redis2NginxModule to 0.08rc3, allowing enabling {{{DDEBUG=1}}} globally.
* upgraded IconvNginxModule to 0.10rc7.
** bugfix: enabling {{{DDEBUG=1}}} globally lead to compilation errors.
** bugfix: could not work with HTTP 1.0 requests.
** optimize: only register output filters when the {{{iconv_filter}}} is actually used in the config file.
* upgraded LuaNginxModule to 0.5.0rc15.
** bugfix: the {{{exptime}}} argument to {{{shdict:set/add/etc}}} methods was incorrectly ignored when the {{{flags}}} argument is also specified. thanks the patch from Brian Akins.
** docs: fixed various typos in docs. thanks 王斌.
** bugfix: for big input data, the cosocket reading methods could result in crashes due to incorrect use of {{{luaL_Buffer}}}. now we eliminate {{{luaL_Buffer}}} altogether by managing the recv buffers ourselves. the recv buffers can also be recycled.
** bugfix: now we avoid using {{{luaL_checkstring}}} which could do another {{{long jump}}} on its own. thanks 王斌.
** bugfix: {{{tcpsocket:setkeepalive()}}} did not return errors when the current connection has readable data or there is still unread data in the LuaNginxModule upstream buffer.
** bugfix: cosocket methods no longer explicitly return {{{nil}}} error strings upon success.
** bugfix: when the parent request takes a request body, the subrequest does not take any bodies, and the subrequest's method is neither {{{PUT}}} nor {{{POST}}}, then the subrequest will no longer inherit the parent request's request body. thanks 欧远宁 for reporting this issue.
** bugfix: data might be accidentally read into the Lua space on idle sockets when the last operation is a read operation *and* a read event suddenly arrives for edge-triggered event models. the same might also apply to write operations too.
** bugfix: invalid reads might happen in the reading iterators returned by the {{{receiveuntil()}}} method which could lead to segfaults. this was a bug in the DFA minimizer's optimized code path.
** bugfix: the {{{closed}}} error would occur for long-running requests that hold the idle cosocket object for a period of time that is longer than the read timeout setting: we should delete the read event timer in time when the {{{receive}}} call has already got a read event. thanks 欧远宁 for reporting this issue.
** logs: added error logs for cosocket timeout errors.
** logs: added detailed error logs for cosocket {{{closed}}} errors.
** optimize: introduced a minor optimization that we can save one {{{recv}}} call when the read event is active *and* the read event is not ready.
** optimize: now we recycle the downstream output buffers to save memory and dynamic allocation times for long-running requests with huge outputs.
** bugfix: C macro directives were used inside a C macro argument which made (at least) gcc 3.2.3 unhappy. thanks Feng Bin.
! Mainline Version 1.0.11.11 - 14 February 2012
* upgraded LuaNginxModule to 0.5.0rc7.
** bugfix: cosocket API could not be used before [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and its friends for fast network access: [[tcpsock:send()|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] method did not reset {{{u->waiting}}} properly. thanks 欧远宁.
! Mainline Version 1.0.11.9 - 13 February 2012
* upgraded LuaNginxModule to 0.5.0rc6.
** bugfix: could not compile with nginx 0.8.x. thanks 欧远宁. this bug had appeared in LuaNginxModule v0.5.0rc1.
** feature: added the [[ngx.sha1_bin|http://wiki.nginx.org/HttpLuaModule#ngx.sha1_bin]] method which returns the binary form of the {{{SHA-1}}} digest.
** bugfix: we incorrectly allowed {{{ngx.null}}} in the string table argument to [[cosocket:send()|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] method.
** feature: allow use of ngx.null in [[ngx.log()|http://wiki.nginx.org/HttpLuaModule#ngx.log]] and [[print()|http://wiki.nginx.org/HttpLuaModule#print]] arguments.
* added Piotr Sikora's CoolkitNginxModule 0.2rc1 to the bundle, which is also enabled by default.
! Mainline Version 1.0.11.7 - 7 February 2012
* upgraded LuaNginxModule to 0.5.0rc5.
** feature: added constant {{{ngx.null}}} which is a {{{NULL}}} light userdata to represent {{{nil}}} values in Lua tables and etc. this is compatible with at least [[lua-cjson|http://www.kyne.com.au/~mark/software/lua-cjson.php]] library's {{{cjson.null}}} constant.
! Mainline Version 1.0.11.5 - 7 February 2012
* upgraded LuaNginxModule to 0.5.0rc4.
** bugfix: setting {{{ngx.header.last_modified}}} was not implemented fully. thanks Brian Akins.
! Mainline Version 1.0.11.3 - 6 February 2012
* upgraded LuaNginxModule to 0.5.0rc3.
** feature: now [[tcpsocket:send()|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] method supports lua tables of string fragments which can save unnecessary string concatenation operations on the Lua land that are usually quite expensive.
** bugfix: fixed issues in debugging logs for the cosocket API.
** feature: added user flags support to the [[shared dictionary API|http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT]]. thanks Brian Akins.
* upgraded LuaRedisParserLibrary to 0.09rc6.
** bugfix: remove unneeded string push operations. thanks Brian Akins.
! Mainline Version 1.0.11.1 - 2 February 2012
* upgraded the Nginx core to 1.0.11.
** see the changes here: http://nginx.org/en/CHANGES-1.0
* upgraded LuaNginxModule to 0.5.0rc1.
** feature: implemented the coroutine-based TCP and Unix Domain client socket API (aka the "cosocket" API) that is mostly compatible with the [[LuaSocket|http://w3.impa.br/~diego/software/luasocket/tcp.html]] library.
** feature: implemented built-in connection pool support for the cosocket API.
** feature: added new function [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] to return a cosocket object for the downstream connection so as to do streaming request body reading. thanks Taylor Weibley for sponsoring the development work.
** optimization: optimized the chain-link and buf recycle logic for the subrequest API and make it share free buffers with the cosocket API.
* upgraded PostgresNginxModule to 0.9.
** bugfix: Fix compatibility with poll, select and /dev/poll event models.
** bugfix: Fix compatibility with ~PostgreSQL 9.x.
** bugfix: Fix compatibility with nginx-1.1.4+.

See ChangeLog1000010 for change log for ngx_openresty 1.0.10.x.
<<toolbar permalink>>
! Mainline Version 1.0.15.11 - 16 June 2012
* upgraded LuaNginxModule to 0.5.0rc32.
** bugfix: [[header_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua]] and its friend would leak memory when it is the only directive of LuaNginxModule configured in a location and the [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]] API is also used there.
** bugfix: Lua global variables was dangerously shared by all the concurrent requests if the special {{{_G}}} table was used in all those {{{*_by_lua}}} and {{{*_by_lua_file}}} directives. thanks chaoslawful for the patches. but please also note that {{{_G}}} is still shared among all the requests if used in the context of Lua modules, just like all those Lua module level variables.
** bugfix: the [[ngx.arg|http://wiki.nginx.org/HttpLuaModule#ngx.arg]] API was not usable within external Lua module files in [[set_by_lua|http://wiki.nginx.org/HttpLuaModule#set_by_lua]] or [[set_by_lua_file|http://wiki.nginx.org/HttpLuaModule#set_by_lua_file]].
** bugfix: unexpected values on the Lua stack might be concatenated when generating tracebacks for Lua errors and the Lua VM would crash when there happened to be values on the Lua stack that could not be concatenated (like {{{nil}}}).
** bugfix: the Lua main thread stack might leak when [[header_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua]] or [[header_filter_by_lua_file|http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua_file]] are used.
** bugfix: the Lua VM might crash when calling the cosocket methods with a bad-typed {{{self}}} argument.
** bufix: fixed the directive context for [[set_by_lua|http://wiki.nginx.org/HttpLuaModule#set_by_lua]] and [[set_by_lua_file|http://wiki.nginx.org/HttpLuaModule#set_by_lua_file]]. they really work in the contexts {{{server}}}, {{{server if}}}, {{{location}}}, and {{{location if}}}. thanks Liu Taihua.
** feature: added new directives [[log_by_lua|http://wiki.nginx.org/HttpLuaModule#log_by_lua]] and [[log_by_lua_file|http://wiki.nginx.org/HttpLuaModule#log_by_lua_file]] to support user Lua code running at the {{{log}}} request processing phase. thanks Matthieu Tourne for the patches.
** feature: added new directives [[body_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]] and [[body_filter_by_lua_file|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua_file]] to allow the user implement nginx output body filters in pure Lua.
** feature: added support for loading Lua/LuaJIT raw bytecode files automatically in all those {{{*_by_lua_file}}} config directives. thanks jinglong and chaoslawful for the patches. benchmark results have shown that, for very big Lua-based web applications, bytecode loading gives an order of magnitude speedup at first requests that trigger the Lua code loading.
** feature: added new directive [[lua_transform_underscores_in_response_headers|http://wiki.nginx.org/HttpLuaModule#lua_transform_underscores_in_response_headers]]. thanks Kindy Lin.
** optimize: now we no longer register the {{{ndk}}} and {{{ngx}}} API for [[set_by_lua|http://wiki.nginx.org/HttpLuaModule#set_by_lua]]* and [[header_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua]]* at config time rather than request time. this makes these directives 200+% faster.
** optimize: eliminated unnecessary string concatenations when generating tracebacks for Lua errors.
** optimize: now we store the metatables for [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] and [[ngx.socket.tcp()|http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp]] objects into the Lua registry.
** optimize: changed the string keys to light userdata for various tracking tables (coroutines table, regex cache table, cosocket connection pool table, [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]] table, and etc). This gives minor performance improvement from eliminating key hashing and etc. thanks Dirk Feytons.
** diagnosis: now we issue user-friendly error messages when the Nginx Lua ~APIs are used in the wrong configure directive contexts (e.g., using [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] in [[set_by_lua|http://wiki.nginx.org/HttpLuaModule#set_by_lua]]).
** docs: fixed a typo: [[ngx.now|http://wiki.nginx.org/HttpLuaModule#ngx.now]] returns time of the resolution of milliseconds, rather than microseconds. thanks Wang Xi.
** docs: added a note for installation with Lua 5.1 on ubuntu 11.10. thanks Dan Sosedoff.
* updated [[nginx-1.0.15-poll_del_event_at_exit.patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.15-poll_del_event_at_exit.patch]]. thanks Maxim Dounin.
! Stable Release 1.0.15.10 - 13 June 2012
This release is essentially equivalent to the devel version 1.0.15.9 except excluding all the vim backup files *~ from the source code distribution. thanks Xiaoyu Chen.

Components bundled:
* ~LuaJIT-2.0.0-beta10
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2rc7
* echo-nginx-module-0.38rc2
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.17rc1
* iconv-nginx-module-0.10rc7
* lua-5.1.4
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.09
* lua-resty-memcached-0.07
* lua-resty-mysql-0.07
* lua-resty-redis-0.09
* lua-resty-string-0.06
* lua-resty-upload-0.03
* memc-nginx-module-0.13rc3
* nginx-1.0.15
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.17
* ngx_lua-0.5.0rc30
* ngx_postgres-0.9
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.08rc4
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.13rc8
* upstream-keepalive-nginx-module-0.7
* xss-nginx-module-0.03rc9
! Mainline Version 1.0.15.9 - 7 June 2012
* upgraded LuaNginxModule to 0.5.0rc30.
** feature: new Lua API, [[ngx.sleep()|http://wiki.nginx.org/HttpLuaModule#ngx.sleep]], for doing non-blocking sleep in Lua. thanks jinglong for the patch.
** feature: [[ngx.log()|http://wiki.nginx.org/HttpLuaModule#ngx.log]] now checks if the log level number is in the valid range (0 ~ 8). thanks Xiaoyu Chen (smallfish) for suggesting this improvement.
** bugfix: [[cosocket:receiveuntil|http://wiki.nginx.org/HttpLuaModule#tcpsock:receiveuntil]] could leak memory, especially for long pattern string arguments. this bug was caught by [[Test::Nginx::Socket|http://search.cpan.org/perldoc?Test::Nginx::Socket]] when setting the environment {{{TEST_NGINX_CHECK_LEAK=1}}}.
** bugfix: [[ngx.re.sub()|http://wiki.nginx.org/HttpLuaModule#ngx.re.sub]] could leak memory when the {{{replace}}} template argument string is not well-formed and the {{{o}}} regex option is also specified. this issue was caught by [[Test::Nginx::Socket|http://search.cpan.org/perldoc?Test::Nginx::Socket]] when setting environment {{{TEST_NGINX_CHECK_LEAK=1}}}.
** bugfix: [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] leaked memory when the {{{o}}} option was not specified. this bug was caught by [[Test::Nginx::Socket|http://search.cpan.org/perldoc?Test::Nginx::Socket]] when setting the environment {{{TEST_NGINX_CHECK_LEAK=1}}}.
** bugfix: the Lua {{{_G}}} special table did not get cleared when [[lua_code_cache|http://wiki.nginx.org/HttpLuaModule#lua_code_cache]] is turned off. thanks Moven for reporting this issue.
** bugfix: [[cosocket:connect()|http://wiki.nginx.org/HttpLuaModule#tcpsock:connect]] might hang on socket creation errors or segfault later due to left-over state flags.
** bugfix: refactored on-demand handler registration. the old approach rewrites to static (global) variables at config-time, which could have potential problems with nginx config reloading via the {{{HUP}}} signal.
** optimize: now we no longer call {{{ngx_http_post_request}}} to wake up the request associated with the current cosocket upstream from within the cosocket upstream event handlers, but rather call {{{r->write_event_handler}}} directly. this change can also make backtraces more meaningful because we preserve the original calling stack.
** docs: massive wording improvements from the Nginx Wiki site. thanks Dayo.
* upgraded RdsJsonNginxModule to 0.12rc10.
** bugfix: refactored on-demand handler registration. the old approach rewrites to static (global) variables at config-time, which could have potential problems with nginx config reloading via the {{{HUP}}} signal.
* bugfix: the (optional) [[no-pool patch|https://github.com/shrimp/no-pool-nginx/]] might leak memory. now we have updated the no-pool patch to the latest version that is a thorough rewrite.
* bugfix: applied [[poll_del_event_at_exit patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.15-poll_del_event_at_exit.patch]] that fixed a segmentation fault in the nginx core when the poll event type is used: http://mailman.nginx.org/pipermail/nginx-devel/2012-June/002328.html
* bugfix: applied the [[resolver_debug_log patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.15-resolver_debug_log_overflow.patch]] that fixed reads of uninitialized memory in the nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2012-June/002281.html
! Mainline Version 1.0.15.7 - 29 May 2012
* bugfix: applied the [[add_core_vars_polluting_globals patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.15-add_core_vars_polluting_globals.patch]] to fix a bug in the nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002231.html
* bugfix: fixed the [[filter_finalize_hang patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.0.15-filter_finalize_hang.patch]] for a regression in the image filters. thanks Maxim Dounin.
* upgraded LuaNginxModule to 0.5.0rc29.
** bugfix: {{{cosocket:receive(0)}}} was not allowed and would throw an error saying {{{0}}} was a bad pattern. thanks huang kun for reporting this issue. This issue at least made LuaRestyRedisLibrary reject reading 0-size values.
** bugfix: the [[set_by_lua|http://wiki.nginx.org/HttpLuaModule#set_by_lua]] directive did support nginx variable interpolation and there was no easy way to use the dollar sign characters in the literal Lua source. the [[set_by_lua_file|http://wiki.nginx.org/HttpLuaModule#set_by_lua_file]] directive still supports nginx variable interpolation in its lua file path argument. thanks Vittly for reporting this in [[github issue #111|https://github.com/chaoslawful/lua-nginx-module/issues/111]] and jinglong for the test in [[github pull #115|https://github.com/chaoslawful/lua-nginx-module/pull/115]].
** bugfix: fixed compilation errors when PCRE is missing. thanks Dirk Feytons for the patch.
** feature: added the {{{[lua]}}} prefix to the log messages produced by [[ngx.log()|http://wiki.nginx.org/HttpLuaModule#ngx.log]] and [[print()|http://wiki.nginx.org/HttpLuaModule#print]]. thanks Matthieu Tourne for the patches.
** feature: [[ngx.log()|http://wiki.nginx.org/HttpLuaModule#ngx.log]] and [[print()|http://wiki.nginx.org/HttpLuaModule#print]] now output more debugging info, i.e., the current lua source file name (if any), the current source line number, and the current calling Lua function name (if any), into the Nginx {{{error.log}}} file. An example message is {{{[error] 56651#0: *1 [lua] test.lua:6: bar():
hello}}}. thanks Matthieu Tourne for the patch.
** feature: added the [[rewrite_by_lua_no_postpone|http://wiki.nginx.org/HttpLuaModule#rewrite_by_lua_no_postpone]] directive which can control whether or not to disable postponing [[rewrite_by_lua|http://wiki.nginx.org/HttpLuaModule#rewrite_by_lua]] and [[rewrite_by_lua_file|http://wiki.nginx.org/HttpLuaModule#rewrite_by_lua_file]] to the end of the {{{access}}} request-processing phase. thanks Matthieu Tourne for the patches.
** feature: added new Lua method [[ngx.decode_args|http://wiki.nginx.org/HttpLuaModule#ngx.decode_args]] to decode ~URI-encoded query strings into Lua tables. thanks Matthieu Tourne for the patches.
** feature: the special {{{$prefix}}} and {{{${prefix} }}} notations can now be used in the directives [[lua_package_path|http://wiki.nginx.org/HttpLuaModule#lua_package_path]] and [[lua_package_cpath|http://wiki.nginx.org/HttpLuaModule#lua_package_cpath]] to indicate the nginx {{{server prefix}}} path (usually determined by the {{{-p PATH}}} command-line option while starting the Nginx server. thanks Matthieu Tourne for the patches.
** docs: various wording improvements in the documentation from Joshua Zhu.
* upgraded RdsJsonNginxModule to 0.12rc9.
** feature: added the {{{rds_json_errcode_key}}} directive to override the default {{{errcode}}} key in the JSON output. thanks Liseen Wan for the patches.
** feature: added the {{{rds_json_errstr_key}}} directive to override the default {{{errstr}}} key in the JSON output. thanks Liseen Wan for the patches.
* upgraded LuaRestyRedisLibrary to 0.09.
** feature: the {{{hmset}}} method can now take a key and a hash-like table as its arguments. thanks Brian Akins for the patches.
** docs: fixed a typo found by Lance in {{{README}}}.
! Mainline Version 1.0.15.5 - 16 May 2012
* upgraded LuaJIT to 2.0.0beta10.
** see changes here: http://luajit.org/changes.html
* feature: added the {{{--with-luajit-xcflags=FLAGS}}} option to {{{./configure}}} to add more C compiler options to LuaJIT's build system.
* upgraded LuaNginxModule to 0.5.0rc28.
** bugfix: [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] did not honor the {{{Expect: 100-continue}}} request header and could hang. thanks Matthieu Tourne for the patch in [[pull request #107|https://github.com/chaoslawful/lua-nginx-module/pull/107]].
** bugfix: the [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] object (i.e., the downstream cosocket object) did not work with HTTP 1.1 pipelined requests at all.
** bugfix: the [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] object might lose the last part of the request body when receiving data. this regression had appeared in v0.5.0rc25. thanks Matthieu Tourne for reporting it.
** feature: detailed backtraces (Lua callstack) will be automatically printed to {{{error.log}}} when the user Lua code is interrupted by Lua exceptions. thanks Matthieu Tourne for the patch in [[pull request #107|https://github.com/chaoslawful/lua-nginx-module/pull/107]].
** optimize: removed dead code found by Simon Liu via scan-build.
* upgraded RdsCsvNginxModule to 0.05rc2.
** bugfix: the output buffer size would get wrong when the {{{affected_rows}}} field is larger than a single-digit number. thanks Wendal Chen for reporting this by using clang.
* upgraded LuaRestyStringLibrary to 0.06.
** feature: added new Lua module {{{resty.random}}} that implements secure random and pseudo-random string generators. thanks Chase Colman for the patch.
** feature: added new Lua module {{{resty.aes}}} that exposes the AES submodule of ~OpenSSL via LuaJIT FFI. thanks Chase Colman for the patch.
! Mainline Version 1.0.15.3 - 13 May 2012
* now we bundle Sergey A. Osokin's RedisNginxModule, 0.3.6, which is also enabled by default. thanks Zhu Feng for requesting this.
* upgraded LuaNginxModule to 0.5.0rc27.
** bugfix: nginx could crash on request finalization when running the cosocket cleanup handle due to the lack of check of the {{{ctx}}} pointer. thanks shaneeb for reporting this in [[github issue #110|https://github.com/chaoslawful/lua-nginx-module/issues/110]].
** bugfix: [[ngx.req.get_body_data()|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_body_data]] could not handle multi-buffer request bodies and discarded the body data after the first buffer.
** bugfix: [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]] was not accessible at all in {{{set_by_lua*}}}. thanks Pierre.
** bugfix: fixed typo "on-array", which should be "non-array", in an error message.
** optimize: now [[ngx.log|http://wiki.nginx.org/HttpLuaModule#ngx.log]] is much faster when the log level argument is lower than the actual [[error_log|http://wiki.nginx.org/CoreModule#error_log]] level specified in nginx.conf. thanks Matthieu Tourne for providing the patch.
** optimize: now we call {{{ngx_http_lua_socket_finalize}}} in {{{cosocket:setkeepalive()}}} to help buffer reuse.
* upgraded SetMiscNginxModule to 0.22rc8.
** feature: added new directives [[set_secure_random_alphanum|http://wiki.nginx.org/HttpSetMiscModule#set_secure_random_alphanum]] and [[set_secure_random_lcalpha|http://wiki.nginx.org/HttpSetMiscModule#set_secure_random_lcalpha|]] for generating cryptographically strong random strings based on the {{{/dev/urandom}}} device. thanks Jeremy Wohl for the patch.
* upgraded SrcacheNginxModule to 0.13rc8.
** bugfix: the {{{Content-Length}}} response header for HEAD requests should leave intact when cache hits happen.
** bugfix: the [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]] subrequest did not set the {{{Content-Length}}} request header properly for multi-buffer request bodies. thanks Feibo Lee for submitting the patch.
** feature: HTTP conditional GET requests are now supported (both {{{If-Modified-Since}}} and {{{If-Unmodified-Since}}} request headers are properly handled). thanks ~Nginx_User777.
* upgraded LuaRedisParserLibrary to v0.09.
** feature: added {{{redis.parser._VERSION}}}.
** bugfix: now we use Lua userdata to allocate memory used on the C side to prevent potential leaks caused by malloc/free, as discussed in [[github issue #6|https://github.com/agentzh/lua-redis-parser/issues/6]].
* upgraded LuaRdsParserLibrary to 0.05.
** feature: added {{{redis.parser._VERSION}}}.
** bugfix: now we use Lua userdata to allocate memory used on the C side to prevent potential leaks caused by malloc/free, as discussed in [[github issue #6|https://github.com/agentzh/lua-redis-parser/issues/6]].
* upgraded LuaRestyMemcachedLibrary to 0.07.
** feature: now the methods for the Memcached storage commands now accept Lua tables as the {{{value}}} argument. thanks Brian Akins for the patch.
* upgraded LuaRestyUploadLibrary to 0.03.
** feature: now the raw headers for each part are also returned, as suggested by zou2062 in [[github issue #1|https://github.com/agentzh/lua-resty-upload/issues/1]].
* applied the patch for a bug in {{{ngx_http_named_location}}} to the nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002166.html
* applied the patch for a bug in the filter finalizer to the nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002190.html
! Mainline Version 1.0.15.1 - 29 April 2012
* upgraded the Nginx core to 1.0.15.
* bugfix: now we also add {{{<openresty_prefix>/lualib/?/init.lua}}} to the default {{{package.path}}} search list. thanks bigplum for reporting this issue.
* upgraded LuaNginxModule to 0.5.0rc25.
** bugfix: cosocket connections from the connection pool might lead to segfaults if it is not used immediately. thanks xukaifu for reporting this as [[github issue #108|https://github.com/chaoslawful/lua-nginx-module/issues/108]].
** bugfix: debug logging in the cosocket receive line method could lead to invalid memory reads under extreme network conditions. this issue was caught by [[mockeagain|https://github.com/agentzh/mockeagain]] in reading mode.
** bugfix: downstream cosockets might hang on the receive(size) method call for slow connections. [[mockeagain|https://github.com/agentzh/mockeagain]] in reading mode caught this issue.
** bugfix: we no longer forcibly quit the lua threads by clearing out its environment and running it blindly to the end because Lua GC will collect all those unfinished coroutines anyway.
** bugfix: improved the longjmp handling when Lua panic happens.
** bugfix: certain compilers might complain about missing declarations for types like {{{int8_t}}}. now we explicitly included {{{stdint.h}}}. thanks runner-mei for reporting it in [[github issue #98|https://github.com/chaoslawful/lua-nginx-module/issues/98]].
** feature: added new constant {{{ngx.HTTP_OPTIONS}}} for the HTTP OPTIONS method.
** feature: added support for OPTIONS method in the subrequest capture ~APIs. thanks Jónas Tryggvi Jóhannsson for requesting this in [[github issue #102|https://github.com/chaoslawful/lua-nginx-module/issues/102]].
** feature: added publich C functions {{{ngx_http_lua_add_package_preload}}}, {{{ngx_http_lua_get_global_state}}}, and {{{ngx_http_lua_get_request}}} to help other Nginx C modules expose new functionalities to LuaNginxModule. thanks Brian Akins for suggesting them in [[github pull request #101|https://github.com/chaoslawful/lua-nginx-module/pull/101]].
** feature: made {{{ngx_http_lua_api.h}}} visible to other Nginx modules by adding {{{src/api/}}} to the {{{CORE_INCS}}} config variable value in the config file. thanks Brian Akins for suggesting this in [[github pull request #105|https://github.com/chaoslawful/lua-nginx-module/pull/105]].
** feature: add the {{{gdbinit}}} script to ease Lua user code debugging (Wang Xiaozhe).
** optimize: various optimizations in cosocket's timeout handling. this gives about 2.5+% performance boost in some benchmarks using LuaRestyRedisLibrary and LuaRestyMySQLLibrary.
* upgraded RdsJsonNginxModule to v0.12rc8.
** bugfix: Microsoft C compilers complained about missing declarations of the type {{{int8_t}}}. now we explicitly include {{{stdint.h}}}. thanks runner-mei for reporting this issue in [[github issue #3|https://github.com/agentzh/rds-json-nginx-module/issues/3]].
* upgraded SetMiscNginxModule to 0.22rc7.
** bugfix: we should omit the [[set_sha1|http://wiki.nginx.org/HttpSetMiscModule#set_sha1]] directive when we do not have any ~SHA1 libraries (including ~OpenSSL) installed. thanks runner-mei for reporting this in [[github issue #9|https://github.com/agentzh/set-misc-nginx-module/issues/9]].
** feature: added new config directive [[set_rotate|http://wiki.nginx.org/HttpSetMiscModule#set_rotate]].
* upgraded DrizzleNginxModule to 0.1.2rc7.
** bugfix: reading data on a reused ~MySQL connection (coming from the connection pool) could hang due to the inactive read event when {{{poll}}} event API is used in nginx.
* upgraded LuaRestyMySQLLibrary to 0.07.
** fixed a typo in error messages.
** skipped parsing those column fields that we do not use (yet). this makes things noticeably faster.

See ChangeLog1000011 for change log for ngx_openresty 1.0.11.x.
<<toolbar permalink>>
! Stable Release 1.2.1.14 - 14 August 2012
* bugfix: the dtrace static probes did not build on ~FreeBSD, Solaris, and Mac OS X (i.e., when the {{{--with-dtrace-probes}}} configure option is specified).
* bugfix: the systemtap tapset files and the {{{stap-nginx}}} script were even installed on non-Linux systems.
* upgraded LuaNginxModule to 0.5.14.
** bugfix: the dtrace provider file did not compile on ~FreeBSD, Solaris, and Mac OS X.
Components bundled:
* ~LuaJIT-2.0.0-beta10
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.2
* echo-nginx-module-0.41
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.18
* iconv-nginx-module-0.10rc7
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.09
* lua-resty-dns-0.05
* lua-resty-memcached-0.07
* lua-resty-mysql-0.10
* lua-resty-redis-0.11
* lua-resty-string-0.06
* lua-resty-upload-0.03
* memc-nginx-module-0.13rc3
* nginx-1.2.1
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.17
* ngx_lua-0.5.14
* ngx_postgres-1.0rc1
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.08rc4
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.14
* xss-nginx-module-0.03rc9
! Mainline Version 1.2.1.13 - 12 August 2012
* upgraded LuaNginxModule to 0.5.13.
** feature: added new directive [[lua_socket_log_errors|http://wiki.nginx.org/HttpLuaModule#lua_socket_log_errors]] that can be used to disable automatic error logging for both the TCP and UDP cosockets. thanks Brian Akins for the patch.
** bugfix: segmentation faults might happen when 1. the nginx worker was shutting down (i.e., the Lua VM is closing),  2. [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] was used, and 3. regex cache is enabled via the {{{o}}} regex flag. this bug had appeared in LuaNginxModule 0.5.0rc30 (and OpenResty 1.0.15.9).
** bugfix: segmentation faults might happen when the system is out of memory: there was one place where we did not check the pointer returned from {{{ngx_array_push}}}.
** bugfix: we should avoid complicated Lua stack operations that might require memory allocaitons in the Lua {{{atpanic}}} handler because it would produce another exception in the handler leading to infinite loops.
* upgraded EchoNginxModule to 0.41.
** bugfix: we incorrectly returned the {{{500}}} error code in our nginx output body filters.
** bugfix: segmentation faults might happen when the system is out of memory: we forgot to check the returned pointer from {{{ngx_calloc_buf}}} in our nginx output body filter.
* upgraded LuaRestyDNSLibrary to 0.05.
** feature: now we use 4096 as the receive buffer size instead of the value 512 that is suggested by RFC 1035. this could avoid data truncation when the DNS server supports datagram sizes larger than 512 bytes.
** feature: now we pick a random nameserver from the nameservers list at the first time.
** docs: fixed a mistake in the sample code and tuned it to be more illustrative. thanks Sandesh Kotwal for reporting.
! Mainline Version 1.2.1.11 - 5 August 2012
* bundled LuaRestyDNSLibrary 0.04 and enabled it by default: https://github.com/agentzh/lua-resty-dns it is a nonblocking DNS (Domain Name System) resolver library based on LuaNginxModule's cosocket API.
* upgraded LuaNginxModule to 0.5.12.
** bugfix: the [[UDP cosocket object|http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp]] could no longer be used after an read or write error happened.
** bugfix: [[ngx.exit(status)|http://wiki.nginx.org/HttpLuaModule#ngx.exit]] always resulted in {{{200 OK}}} response status when status > 200 and status < 300. thanks Nginx User for reporting this issue.
* upgraded HeadersMoreNginxModule to 0.18.
** bugfix: fixed a {{{set-but-not-read}}} warning from the {{{clang}}} static code analyzer.
** fixed compatibility with nginx 0.7.65. thanks Banping for reporting this.
* upgraded DrizzleNginxModule to 0.1.2.
** minor code cleanup in the built-in connection pool.
! Mainline Version 1.2.1.9 - 30 July 2012
* upgraded LuaRestyMySQLLibrary to 0.10.
** bugfix: the ~MySQL {{{bigint}}} fields might overflow when converting to lua numbers. now we no longer convert such fields into Lua numbers and instead, just treat them as Lua strings. thanks Lance Li for reporting this issue.
* upgraded LuaNginxModule to 0.5.11.
** feature: added new Lua API [[ngx.req.init_body|http://wiki.nginx.org/HttpLuaModule#ngx.req.init_body]], [[ngx.req.append_body|http://wiki.nginx.org/HttpLuaModule#ngx.req.append_body]], and [[ngx.req.finish_body|http://wiki.nginx.org/HttpLuaModule#ngx.req.finish_body]]. thanks Matthieu Tourne for the patches. These new functions can be used with the existing "downstream cosocket API" (provided by [[ngx.req.socket|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]]) to implement efficient Nginx "input filters" in pure Lua.
** feature: added new Lua API [[ngx.get_phase|http://wiki.nginx.org/HttpLuaModule#ngx.get_phase]] for retrieving the current running phase of the Lua code being executed. thanks James Hurst for the patch.
** feature: added the first dtrace static probe: {{{nginx_lua:::http-lua-register-preload-package}}} and {{{nginx_lua:::http-lua-req-socket-consume-preread}}}.
** bugfix: {{{buffer error}}} would happen when the {{{args}}} option table to [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] (and [[ngx.encode_args|http://wiki.nginx.org/HttpLuaModule#ngx.encode_args]]) contained a multi-value argument whose key also required URI escaping. thanks Matthieu Tourne for reporting this.
** bugfix: [[ngx.re.gmatch()|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] might result in segmentation faults during nginx request cleanups if the iterator returned by [[ngx.re.gmatch()|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] was collected (by Lua GC) before request cleanups. this bug had appeared in LuaNginxModule 0.5.0rc30 (and OpenResty 1.0.15.9). thanks Wayne for reporting this issue.
** bugfix: 3rd-party nginx C modules that use the public C API function, {{{ngx_http_lua_add_package_preload}}}, could result in segmentation faults at nginx server startup due to uninitialized Lua VM pointer. thanks Ray Bejjani for reporting this.
** bugfix: Proper error messages were not always thrown when the iterator returned by [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] was (incorrectly) used in the context of another nginx request.
** bugfix: fixed several Clang compilation warnings.
* feature: applied the [[dtrace patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.1-dtrace.patch]] to the nginx core that adds dtrace static probing support for both the Nginx core and 3rd-party modules to the Nginx build system. this support can be enabled by {{{./configure --with-dtrace-probes}}}.
* feature: added new dtrace static probes to the Nginx core
** added 8 kinds of static probes to the subrequest mechanism: {{{nginx:::http-subrequest-cycle}}}, {{{nginx:::http-subrequest-start}}}, {{{nginx:::http-subrequest-finalize-writing}}}, {{{nginx:::http-subrequest-finalize-nonactive}}}, {{{nginx:::http-subrequest-wake-parent}}}, {{{nginx:::http-subrequest-done}}}, {{{nginx:::http-subrequest-post-start}}}, and {{{nginx:::http-subrequest-post-done}}}.
** added 2 kinds of static probes to the standard request body reader: {{{nginx:::http-read-body-abort}}} and {{{nginx:::http-read-body-done}}}.
** added 2 kinds of static probes to the standard main request header reader: {{{nginx:::http-read-req-line-done}}} and {{{nginx:::http-read-req-header-done}}}.
** added 1 kind of static probes to the configuration loader: {{{nginx:::http-module-post-config}}}.
** added the {{{nginx.stp}}} stapset script for systemtap: https://github.com/agentzh/nginx-dtrace/blob/master/src/dtrace/nginx.stp
** added the [[stap-nginx|https://github.com/agentzh/nginx-dtrace/blob/master/src/dtrace/stap-nginx]] wrapper sh script for systemtap's {{{stap}}} command for nginx. this script will be installed to {{{$PREFIX/sbin/}}} when the {{{./configure}}} option {{{--with-dtrace-probes}}} is specified.
* bugfix: fixed an issue regarding subrequests in [[allow_request_body_updating.patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.1-allow_request_body_updating.patch]].
! Mainline Version 1.2.1.7 - 14 July 2012
* upraded HeadersMoreNginxModule to 0.17.
** bugfix: [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not remove all the instances for the built-in headers or custom headers.
** bugfix: [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] might accidentally remove request headers that were not specified at all and left the specified headers with just empty header values when removing multiple built-in headers. thanks Matthieu Tourne for reporting the issues.
* upgraded LuaNginxModule to 0.5.7.
** feature: added an optional "option table" to [[tcpsock:connect()|http://wiki.nginx.org/HttpLuaModule#tcpsock:connect]] which accepts a {{{pool}}} option to allow the user specify a custom pool name intead of the automatically generated one based on the host-port pair or the socket file path. thanks Brian Akins for the patches.
** feature: implemented the UDP/unix-datagram cosocket API. the entry point is [[ngx.socket.udp|http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp]]. we preserve API compatibility with the ~LuaSocket library but everything is non-blocking in our implementation.
** feature: added new Nginx API for Lua: [[ngx.req.set_method(method_id)|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_method]] and [[ngx.req.get_method|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_method]]. thanks Matthieu Tourne for suggesting these.
** bugfix: the tcp/stream-unix cosocket object might hang when another concurrent request is accessing it while its operation is still in progress; now we always check for potential access conflicts and return the {{{socket busy}}} error string if it is indeed the case.
** bugfix: the [[tcpsock:connect()|http://wiki.nginx.org/HttpLuaModule#tcpsock:connect]] method always returned the (vague) error strng {{{"connect peer error"}}} instead of the (detailed) system error string when the connect syscall failed.
** bugfix: the TCP/stream-unix cosocket object might go wrong after it connected successfully in a single run (that is, no {{{EAGAIN}}} returned in the middle) and DNS domain names were used.
** bugfix: [[tcpsock:receive()|http://wiki.nginx.org/HttpLuaModule#tcpsock:receive]] and [[tcpsock:send()|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] always returned {{{"error"}}} as the error message instead of the (detailed) system error string.
** bugfix: [[ngx.req.clear_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not remove all the instances for the built-in headers or custom headers.
** bugfix: [[ngx.req.clear_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] might accidentally remove request headers that are not specified at all and left the specified headers with just empty header values when removing multiple built-in headers. thanks Matthieu Tourne for reporting the issues.
** bugfix: we did not always test if the request object pointer is null in the {{{ngx.req.*_body}}} API.
** bugfix: [[ngx.exec()|http://wiki.nginx.org/HttpLuaModule#ngx.exec]] did not accept the {{{nil}}} value for its second (optional) argument.
** bugfix: {{{ngx.exit(404/500/...)}}} would throw out Lua errors when the response headers with exactly the same status code had already been sent. thanks Matthieu Tourne for reporting this.
** bugfix: gcc might issue the "unused variable" warning when PCRE was disabled. thanks Dirk Feytons for the patch.
* upgraded LuaRestyRedisLibrary to 0.11.
** feature: added the {{{array_to_hash}}} method. thanks Brian Akins for the patch in [[github #8|https://github.com/agentzh/lua-resty-redis/pull/8]].
* upgraded LuaRestyMySQLLibrary to 0.09.
** feature: added the {{{compact_arrays}}} option to the {{{connect()}}} method to make the driver return arrays of arrays instead of the (default) arrays of hashes. thanks Lance Li for requesting this feature.
** feature: added new method {{{set_compact_arrays}}} to change the current {{{compact_arrays}}} option value used by the current object for subsequent queries. thanks Lance Li for suggesting it.
** feature: added the {{{pool}}} option to the {{{connect()}}} method.
** bugfix: connections to different ~MySQL databases and/or different ~MySQL users would incorrectly share the same connection pool as long as they were connecting to the same ~MySQL server. thanks lhmwzy for reporting the issue.
** docs: fixed the {{{path}}} option value for the {{{connect()}}} method in README. it should not take the {{{unix:}}} prefix. thanks Lance Li.
** docs: documented that storing the object instance into lua module-level variables will result in failures for concurrent requests.
** docs: documented that this library cannot be used in those contexts where the cosocket API is unavailable.
* upgraded the standard Lua interpreter to 5.1.5.
* disabled the Lua 5.0 compatibility in the standard Lua interpreter bundled.
! Mainline Version 1.2.1.5 - 4 July 2012
* upgraded LuaNginxModule to 0.5.5.
** feature: added new configure directives [[init_by_lua|http://wiki.nginx.org/HttpLuaModule#init_by_lua]] and [[init_by_lua_file|http://wiki.nginx.org/HttpLuaModule#init_by_lua_file]]. they can be used to pre-load Lua modules, registering true Lua global variables, and initializing the shared-memory storage defined via [[lua_shared_dict|http://wiki.nginx.org/HttpLuaModule#lua_shared_dict]], at Nginx config-loading time. thanks drdrxp for suggesting this new feature.
** feature: now we print backtrace to {{{error.log}}} when Lua errors happen in [[set_by_lua|http://wiki.nginx.org/HttpLuaModule#set_by_lua]]*, [[header_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua]]*, [[body_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]]*, and [[log_by_lua|http://wiki.nginx.org/HttpLuaModule#log_by_lua]].
** bugfix: upstream data buffers were not marked as fully consumed when [[body_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]]* was used and {{{ngx.arg[1]}}} was overwritten. this could result in connection hang for large response bodies. thanks Tzury Bar Yochay for reporting this issue.
** bugfix: gcc complained that "dereferencing type-punned pointer will break strict-aliasing rules" when {{{-O2}}} or above was enabled while compiling. thanks Ryan Ooi for reporting this and chaoslawful for fixing it.
* upgraded LuaRestyRedisLibrary to 0.10.
** feature: added the Redis {{{script}}} command introduced in Redis 2.6. thanks Evgeniy Dolzhenko for suggesting this.
** docs: documented that storing the object instance into lua module-level variables will result in failures for concurrent requests.
** docs: documented that this lib cannot be used in those contexts where the ngx_lua cosocket API is unavailable.
* upgraded SrcacheNginxModule to 0.14.
** feature: added new nginx variable [[$srcache_fetch_status|http://wiki.nginx.org/HttpSRCacheModule#.24srcache_fetch_status]] which takes one of three values, {{{BYASS}}}, {{{MISS}}}, and {{{HIT}}}. thanks Feibo Li for the patch.
** feature: added new Nginx variable [[$srcache_store_status|http://wiki.nginx.org/HttpSRCacheModule#.24srcache_store_status]] which takes the value {{{BYASS}}} or {{{STORE}}}.
** optimize: removed unused context data field {{{fetch_sr}}} on the C level to reduce the memory footprint a bit.
! Mainline Version 1.2.1.3 - 25 June 2012
* upgraded EchoNginxModule to 0.40.
** feature: added new directive [[echo_status|http://wiki.nginx.org/HttpEchoModule#echo_status]] which can be used to specify a different default response status code other than 200. thanks Maxime Corbeau for requesting this.
* upgraded LuaNginxModule to 0.5.3.
** bugfix: [[ngx.say|http://wiki.nginx.org/HttpLuaModule#ngx.say]] and [[ngx.print|http://wiki.nginx.org/HttpLuaModule#ngx.print]] might cause nginx to crash when table-typed arguments were given. thanks sztanpet for reporting this in [[github issue #54|https://github.com/chaoslawful/lua-nginx-module/issues/54#issuecomment-6527745]].
* applied [[location_if_inherits_proxy.patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.1-location_if_inherits_proxy.patch]] to the nginx core. see http://mailman.nginx.org/pipermail/nginx-devel/2012-June/002374.html for details.
! Mainline Version 1.2.1.1 - 22 June 2012
* upgraded the Nginx core to 1.2.1.
** see the change log: http://nginx.org/en/CHANGES-1.2
* upgraded LuaNginxModule to 0.5.2.
** bugfix: [[header_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#header_filter_by_lua]]* did not run at all when [[body_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]]* was defined at the same time. thanks Tzury Bar Yochay for reporting this issue.
** feature: added the {{{inclusive}}} option to the [[cosocket:receiveuntil|http://wiki.nginx.org/HttpLuaModule#tcpsock:receiveuntil]] method to include the delimiter pattern string in the resulting data read. thanks Matthieu Tourne for the patch.
** optimize: merged two successive Nginx pool allocations in {{{ngx_http_lua_socket_resolve_handler}}} to reduce overhead.
* upgraded EchoNginxModule to 0.39.
** bugfix: EchoNginxModule's configure directives was not inherited automatically by {{{location if}}} inner blocks.
** bugfix: the old HTTP 1.0 protocol handling was wrong. we should leave that to the Nginx core and just output responses without a {{{Content-Length}}} response header.
** bugfix: reading the [[$echo_it|http://wiki.nginx.org/HttpEchoModule#.24echo_it]] variable outside the [[echo_foreach_split|http://wiki.nginx.org/HttpEchoModule#echo_foreach_split]] loop resulted in memory invalid reads and hence segfaults; now it is evaluates to the special {{{not found}}} value. thanks baqs for reporting this.
* upgraded PostgresNginxModule to 1.0rc1.
** bugfix: memory leak might happen if nginx 1.1.14+ was used and (at least) {{{libpq}}} failed to connect to the remote database.
* upgraded the (optional) no-pool patch to the latest version, {{{642ae25}}}.
** bugfix: we should postpone freeing the {{{elts}}} storage for {{{ngx_array_t}}} to {{{ngx_array_destroy}}} when resizing the array because at least the {{{ngx_rewrite}}} module stores external references to the array elements.

See ChangeLog1000015 for change log for ngx_openresty 1.0.15.x.
<<toolbar permalink>>
! Stable Release 1.2.3.8 - 8 October 2012
This release is essentially the same as the development version 1.2.3.7.

The following components are bundled:
* ~LuaJIT-2.0.0-beta10
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.4
* echo-nginx-module-0.41
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.18
* iconv-nginx-module-0.10rc7
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.08
* lua-resty-memcached-0.08
* lua-resty-mysql-0.10
* lua-resty-redis-0.14
* lua-resty-string-0.06
* lua-resty-upload-0.03
* memc-nginx-module-0.13rc3
* nginx-1.2.3
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.17
* ngx_lua-0.6.10
* ngx_postgres-1.0rc2
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.09
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.16
* xss-nginx-module-0.03rc9
! Mainline Version 1.2.3.7 - 6 October 2012
* upgraded LuaNginxModule to 0.6.10.
** feature: now [[ngx.req.get_headers()|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers]] returns a Lua table with keys in the all-lower-case form by default. thanks James Hurst and Matthieu Tourne for the feature request.
** feature: now [[ngx.req.get_headers()|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers]] adds an {{{__index}}} metamethod to the resulting Lua table by default, which will automatically normalize the lookup key by converting upper-case letters and underscores in case of a lookup miss. thanks James Hurst and Matthieu Tourne for suggesting this feature.
** feature: now [[ngx.req.get_headers()|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers]] accepts a second (optional) argument, {{{raw}}}, for controlling whether to return the original form of the header names (that is, the original letter-case).
** feature: added public C API functions {{{ngx_http_shared_dict_get}}} and {{{ngx_http_lua_find_zone}}} to allow other Nginx C modules or a patched Nginx core to directly access the [[shared memory dictionaries|http://wiki.nginx.org/HttpLuaModule#lua_shared_dict]] created by LuaNginxModule. thanks Piotr Sikora for requesting this feature.
** bugfix: fixed a compilation warning in the TCP/stream cosocket codebase when using (at least) gcc 3.4.6 for MIPS. thanks Dirk Feytons for reporting this as [[GitHub issue #162|https://github.com/chaoslawful/lua-nginx-module/issues/162]].
! Mainline Version 1.2.3.5 - 1 October 2012
* upgraded LuaNginxModule to 0.6.8.
** bugfix: [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] might loop infinitely when the pattern matches an empty string. thanks Lance Li and xingxing for tracking this issue down.
** bugfix: pattern matching an empty substring in [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] did not match at the end of the subject string.
** bugfix: [[ngx.re.gsub|http://wiki.nginx.org/HttpLuaModule#ngx.re.gsub]] might enter infinite loops because it could not handle patterns matching empty strings properly.
** bugfix: [[ngx.re.gsub|http://wiki.nginx.org/HttpLuaModule#ngx.re.gsub]] incorrectly skipped matching altogether when the subject string was empty.
! Mainline Version 1.2.3.3 - 26 September 2012
* upgraded LuaNginxModule to 0.6.7.
** feature: implemented the [[shdict:flush_expired(max_count?)|http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.flush_expired]] method for flushing out and removing expired items up to {{{max_count}}} (or unlimited when {{{max_count == 0}}}). thanks Brian Akins for the patch.
** optimize: [[tcpsock:send()|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] now calls {{{c->send()}}} instead of {{{ngx_output_chain()}}}, which gives about 4% ~ 5% performance boost for a simple test case accessing Redis for several times.
** optimize: we now skip processing in the default write event handler when the write event is not ready.
** refactor: the I/O scheduler has been rewritten to keep track of the coroutine associated with each (non-blocking) I/O operation automatically, which paves a way to the upcoming {{{ngx.thread}}} API (aka the "lightweight thread" API).
** refactor: now we use a new Nginx subrequest model that bypasses {{{ngx_http_postpone_filter_module}}} completely, which paves a way for arbitrary order of outputting among subrequests and their parents when the {{{ngx.thread API}}} lands in the near future.
** bugfix: the "http finalize non-active request" alerts might happen when subrequests were used. thanks Lance Li for reporting this issue.
** bugfix: reset the subrequest status code when the {{{ngx_http_upstream}}} request in the subrequest fails due to timeout errors or premature connection close and etc. this fix also requires the [[nonbuffered-upstream-truncation patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch]] for the Nginx core to cancel a limitation in {{{ngx_http_upstream}}}.
** bugfix: fixed the gcc error {{{-Werror=strict-aliasing}}} in the Lua/LuaJIT bytecode loader when {{{-O2}}} or above is used. thanks jinglong for the patch.
** bugfix: the main request might be prematurely terminated if a subrequest issued by [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] (or its friends) was finalized with error codes.
** bugfix: the Nginx built-in resolver might not be destroyed in time when it was used by [[ngx.socket.tcp|http://wiki.nginx.org/HttpLuaModule#ngx.socket.tcp]] and [[ngx.socket.udp|http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp]].
** bugfix: [[coroutine.status()|http://wiki.nginx.org/HttpLuaModule#coroutine.status]] returned {{{suspended}}} for {{{normal}}} coroutines.
** bugfix: [[coroutine.resume()|http://wiki.nginx.org/HttpLuaModule#coroutine.resume]] did not return an error immediately when operating on {{{normal}}} coroutines.
** bugfix: when the entry coroutine was yielded by [[coroutine.yield()|http://wiki.nginx.org/HttpLuaModule#coroutine.yield]] then after it was resumed automatically its status would still be {{{suspended}}}.
** bugfix: the write event timer might not be removed in time in [[ngx.flush(true)|http://wiki.nginx.org/HttpLuaModule#ngx.flush]] when {{{ngx_handle_write_event}}} failed.
** bugfix: always remove the read event timer during downstream cosocket finalization if it is not removed yet.
** bugfix: [[ngx.flush(true)|http://wiki.nginx.org/HttpLuaModule#ngx.flush]] might not return immediately when it should.
** bugfix: the {{{resume_handler}}} field of the subrequest {{{ctx}}} was not properly initialized.
** feature: added new dtrace static probes {{{http-lua-user-coroutine-yield}}} and {{{http-lua-entry-coroutine-yield}}}.
** docs: fixed the documentation for [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] and made it clear that the modified request headers will be inherited by the subrequests by default. thanks James Hurst for reporting this issue.
** docs: documented the trick for doing background asynchronous jobs by using [[ngx.eof()|http://wiki.nginx.org/HttpLuaModule#ngx.eof]] + {{{keepalive_timeout 0}}}. thanks Lance Li for the suggestion.
* upgraded LuaRedisParserLibrary to 0.10.
** bugfix: Lua stack overflow would happen when too many Redis arguments were passed into the [[build_query|http://wiki.nginx.org/LuaRedisParser#build_query]] method. thanks Guo Yin for reporting this issue.
* upgraded LuaRestyDNSLibrary to 0.08.
** feature: added new method [[tcp_query|https://github.com/agentzh/lua-resty-dns#tcp_query]] to enforce pure TCP transportation for the DNS queries.
** feature: added support for TCP retries when the UDP reply gets truncated.
** feature: added support for {{{PTR}}} queries and records.
** feature: added support for {{{TXT}}} queries and records.
** feature: added support for {{{NS}}} queries and records.
** bugfix: the udp resolver did not discard DNS replies with unmatched ~IDs for 128 times as originally designed.
* upgraded LuaRestyRedisLibrary to 0.14.
** optimize: now we do the string concatenation for Redis queries on the Lua land instead of on the C land, which gives 6% ~ 7% over-all performance boost when using LuaJIT 2.0 beta10.
** docs: fixed a typo in the sample code. thanks xingxing for reporting it.
* upgraded LuaRestyMemcachedLibrary to 0.08.
** feature: added new option {{{key_transform}}} to the [[new method|https://github.com/agentzh/lua-resty-memcached#new]] to allow the user to override the default escaping and unescaping methods for Memcached keys. thanks Matthieu Tourne for the patch.
** bugfix: now the [[new method|https://github.com/agentzh/lua-resty-memcached#new]] will return a string describing the error as the second return value in case of failures.
** docs: added more documentation for the [[set_keepalive|https://github.com/agentzh/lua-resty-memcached#set_keepalive]] method.
** docs: documented that this library cannot be used in those contexts where the LuaNginxModule cosocket API is unavailable.
** docs: documented that storing the object instance into Lua module-level variables will result in failures for concurrent requests.
* upgraded SrcacheNginxModule to 0.16.
** bugfix: [[srcache_fetch|http://wiki.nginx.org/HttpSRCacheModule#srcache_fetch]] would use truncated responses from MemcNginxModule or other upstream modules. this usually happened when the upstream read timer was expired or the upstream prematurely closed the connection. this fix also requires the [[nonbuffered-upsteram-truncation patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch]] to cancel a limitation in the Nginx core. thanks Bryan Alger for reporting the issue.
** bugfix: the main request response was not discarded by [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]] when there was an error in the last minute (like a read-timeout error or premature connection close happens when {{{ngx_http_upstream}}} reads the upstream response body). this fix also requires the [[nonbuffered-upstream-truncation patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch]] for the Nginx core to cancel a limitation in {{{ngx_http_upstream}}}.
** bugfix: the main request might prematurely terminate if the [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]] subrequest was finalized with error codes.
* upgraded Redis2NginxModule to 0.09.
** bugfix: directives [[redis2_query|http://wiki.nginx.org/HttpRedis2Module#redis2_query]], [[redis2_literal_raw_query|http://wiki.nginx.org/HttpRedis2Module#redis2_literal_raw_query]], and [[redis2_raw_queries|http://wiki.nginx.org/HttpRedis2Module#redis2_raw_queries]] could not be inherited automatically by the {{{location if}}} blocks, resulting in the "no redis2 query specified or the query is empty" error. thanks Tomasz Prus for the patch.
* feature: updated the [[dtrace patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-dtrace.patch]] to add new static probe {{{create-pool-done}}}.
* feature: updated the [[dtrace patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-dtrace.patch]] to include new tapset functions {{{ngx_indent}}}, {{{ngx_http_subreq_depth}}}, and {{{ngx_http_req_parent}}}.
* bugfix: added the [[nonbuffered-upstream-truncation patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-nonbuffered-upstream-truncation.patch]] for the Nginx core to make {{{ngx_http_upstream}}} provide a way in the context of a subrequest to signal the parent of errors when upstream data truncation happens. thanks Bryan Alger for reporting this issue. (This is a temporary solution and I'll work on a new patch as per Maxim Dounin's suggestions.)
* bugfix: applied the [[channel-uninit-params patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-channel-uninit-params.patch]] for the Nginx core to fix Valgrind/Memcheck warnings about unitialized bytes in the parameters of {{{sendmsg}}}.
* feature: updated the [[allow_request_body_updating patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.3-allow_request_body_updating.patch]] to define the {{{HAVE_ALLOW_REQUEST_BODY_UPDATING_PATCH}}} macro.
! Mainline Version 1.2.3.1 - 22 August 2012
* upgraded the Nginx core to 1.2.3.
** see http://nginx.org/en/CHANGES-1.2 for changes.
* upgraded LuaNginxModule to 0.6.2.
** feature: (re)implemented the standard Lua [[coroutine API|http://wiki.nginx.org/HttpLuaModule#coroutine.create]], which means that the user is now free to create and run their own coroutines within the boilerplate coroutine created automatically by LuaNginxModule. thanks chaoslawful and jinglong for the design and implementation.
** feature: added new dtrace static probes for the user coroutine mechanism: {{{http-lua-coroutine-create}}} and {{{http-lua-coroutine-resume}}}.
** feature: added new dtrace static probes for the cosocket mechanism: {{{http-lua-socket-tcp-send-start}}}, {{{http-lua-socket-tcp-receive-done}}}, and {{{http-lua-socket-tcp-setkeepalive-buf-unread}}}.
** bugfix: the send timeout timer for downstream output was not deleted in time in our write event handler, which might result in request abortion for long running requests. thanks Demiao Lin (ldmiao) for reporting this issue.
** bugfix: [[tcpsock:send()|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] might send garbage if it was not the first call: we did not properly initialize the chain writer ctx for every {{{send()}}} call. thanks Zhu Dejiang for reporting this issue.
** bugfix: the {{{ngx_http_lua_probe.h}}} header file was not listed in the {{{NGX_ADDON_DEPS}}} list in the {{{config}}} file.
** optimize: removed unnecessary code that was for the old coroutine abortion mechanism based on Lua exceptions. we no longer need that at all because we have switched to using coroutine yield to abort the current coroutine for {{{ngx.exec}}}, {{{ngx.exit}}}, {{{ngx.redirect}}}, and {{{ngx.req.set_uri(uri, true)}}}.
* upgraded LuaRestyDNSLibrary to 0.06.
** feature: added support for MX type resource records.
** feature: unrecognized types of resource records will return their raw resource data (RDATA) as the {{{rdata}}} Lua table field.
* upgraded LuaRestyRedisLibrary to 0.13.
** feature: added new method [[read_reply|https://github.com/agentzh/lua-resty-redis#read_reply]], mostly for using the [[Redis Pub/Sub API|http://redis.io/topics/pubsub/]].
** feature: added new class method [[add_commands|https://github.com/agentzh/lua-resty-redis#add_commands]] to allow adding support for new Redis commands on-the-fly. thanks Praveen Saxena for requesting this feature.
** docs: added a code sample for using the [[Redis transactions|https://github.com/agentzh/lua-resty-redis#redis-transactions]].
* upgraded DrizzleNginxModule to 0.1.4.
** bugfix: the {{{open socket #N left in connection}}} alerts would appear in the nginx error log file when the ~MySQL/Drizzle connection pool was used and the worker process was shutting down.
* upgraded PostgresNginxModule to 1.0rc2.
** bugfix: the {{{open socket #N left in connection}}} alerts would appear in the nginx error log file when the ~PostgreSQL connection pool was used and the worker process was shutting down.
** bugfix: removed the useless http-cache related code from {{{ngx_postgres_upstream_finalize_request}}} to suppress clang warnings.
* added more dtrace static probes to the Nginx core: {{{timer-add}}}, {{{timer-del}}}, and {{{timer-expire}}}.
* added more [[systemtap|http://sourceware.org/systemtap/]] tapset functions: {{{ngx_chain_next}}}, {{{ngx_chain_writer_ctx_out}}}, {{{ngx_chain_dump}}}, and {{{ngx_iovec_dump}}}.

See ChangeLog1002001 for change log for OpenResty 1.2.1.x.
<<toolbar permalink>>
! Stable Release 1.2.4.14 - 23 December 2012
* upgraded LuaNginxModule to 0.7.9.
** bugfix: assignment to [[ngx.status|http://wiki.nginx.org/HttpLuaModule#ngx.status]] would always be overridden by the later [[ngx.exit()|http://wiki.nginx.org/HttpLuaModule#ngx.exit]] calls for HTTP 1.0 requests if [[lua_http10_buffering|http://wiki.nginx.org/HttpLuaModule#lua_http10_buffering]] is on (the default setting). thanks chenshu for reporting this issue.
** bugfix: there was a typo in the error message when accessing an Nginx variable that has not been defined.
** docs: documented the request body automatic inheritance behaviour in [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]].
** docs: fixed incorrect dates shown in the code samples for [[ngx.http_time|http://wiki.nginx.org/HttpLuaModule#ngx.http_time]] and [[ngx.parse_http_time|http://wiki.nginx.org/HttpLuaModule#ngx.parse_http_time]]. thanks Gosuke Miyashita for the patch.
* upgraded LuaRestyUploadLibrary to 0.05.
** bugfix: unexpected runtime exceptions would be thrown when {{{resty.upload}}} met a in-part header field line or a terminating boundary line that was too long. this bug had appeared in LuaRestyUploadLibrary 0.04 and OpenResty 1.2.4.7.
** bugfix: {{{resty.upload}}} could not parse {{{Content-Type}}} request header values like {{{boundary="simple boundary"}}}, that is, with double quotes around the boundary value.
** optimize: marked internal auxiliary functions as Lua {{{local}}} functions.
The following components are bundled:
* ~LuaJIT-2.0.0
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.4
* echo-nginx-module-0.41
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07rc5
* headers-more-nginx-module-0.19
* iconv-nginx-module-0.10rc7
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.09
* lua-resty-memcached-0.10
* lua-resty-mysql-0.12
* lua-resty-redis-0.15
* lua-resty-string-0.08
* lua-resty-upload-0.05
* memc-nginx-module-0.13rc3
* nginx-1.2.4
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.17
* ngx_lua-0.7.9
* ngx_postgres-1.0rc2
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.09
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.16
* xss-nginx-module-0.03rc9
! Mainline Version 1.2.4.13 - 11 December 2012
* upgraded LuaNginxModule to 0.7.8.
** bugfix: [[ngx.req.set_body_file()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_file]] might lead to memory issues because it directly used the storage of Lua strings allocated by the Lua GC (we should have allocated a new memory block on the Nginx side and copy the string data over).
* upgraded LuaRestyMySQLLibrary to 0.12.
** feature: convert the ~MySQL {{{newdecimal}}} typed fields to Lua numbers by default as requested by shedar.
** optimize: marked the internal Lua function {{{_recv_packet}}} as a {{{local}}} function.
! Mainline Version 1.2.4.11 - 8 December 2012
* upgraded LuaNginxModule to 0.7.7.
** feature: added [[ngx.req.start_time()|http://wiki.nginx.org/HttpLuaModule#ngx.req.start_time]] to return the request starting time in seconds (the milliseconds part is the decimal part just as in [[ngx.now|http://wiki.nginx.org/HttpLuaModule#ngx.now]]). thanks Matthieu Tourne for the patch.
** feature: setting [[ngx.status|http://wiki.nginx.org/HttpLuaModule#ngx.status]] or calling [[ngx.exit(N)|http://wiki.nginx.org/HttpLuaModule#ngx.exit]] (where {{{N >= 300}}}) after sending out response headers no longer yields a Lua exception but only leaves an error message in the error.log file, which is useful for Lua land debugging. thanks Matthieu Tourne for requesting this.
** feature: the user can now call [[ngx.exit(444)|http://wiki.nginx.org/HttpLuaModule#ngx.exit]] to abort pending subrequests in other "light threads" from within a "light thread".
** feature: added new dtrace static probe {{{http-lua-user-thread-wait}}}.
** bugfix: [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]] might hang infinitely because the parent request might not be waken up right after the first time the {{{post_subrequest}}} callback was called.
** bugfix: the "light thread" object created by [[ngx.thread.spawn()|http://wiki.nginx.org/HttpLuaModule#ngx.thread.spawn]] or [[ngx.on_abort()|http://wiki.nginx.org/HttpLuaModule#ngx.on_abort]] might be prematurely collected by the Lua GC because we did not correctly register its coroutine object into the Lua registry table. this bug may crash the Lua VM and Nginx workers under load. thanks Zhu Dejiang for reporting this issue.
** bugfix: [[ngx.thread.wait()|http://wiki.nginx.org/HttpLuaModule#ngx.thread.wait]] might hang infinitely when more than 4 user "light threads" are created in the same request handler due to the incorrect use of {{{ngx_array_t}}} for {{{ngx_list_t}}}. thanks Junwei Shi for reporting this issue.
** bugfix: when a user coroutine or user "light thread" dies with an error, our Lua backtrace dumper written in C may access one of its dead parent threads (if any) which could lead to segmentation faults.
** bugfix: [[ngx.exit(N)|http://wiki.nginx.org/HttpLuaModule#ngx.exit]] incorrectly threw out Lua exceptions when {{{N}}} was 408, 499, or 444 and the response header was already sent. thanks Kindy Lin for reporting this issue.
** bugfix: when the user callback function registered by [[ngx.on_abort()|http://wiki.nginx.org/HttpLuaModule#ngx.on_abort]] discarded the client abort event, the request would be aborted by force when the next client abort event happened.
** bugfix: an English typo in the error message for [[init_by_lua*|http://wiki.nginx.org/HttpLuaModule#init_by_lua]].
* applied [[slab_alloc_no_memory_as_info.patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.4-slab_alloc_no_memory_as_info.patch]] to lower the log level of the error message "ngx_slab_alloc() failed: no memory" from "crit" to "info".
* bugfix: the [[upstream_pipelining patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.4-upstream_pipelining.patch]] introduced a regression that when {{{upstream_next}}} is in action, Nginx might hang. thanks Kindy Lin for reporting this issue.
* bugfix: include the latest changes in the LuaJIT 2.0 git repository (up to git commit 2ad9834d).
! Mainline Version 1.2.4.9 - 20 November 2012
* upgraded LuaJIT to 2.0.0 final.
** change logs: http://luajit.org/changes.html
* upgraded LuaNginxModule to 0.7.5.
** bugfix: [[ngx.req.clear_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] would result in memory invalid reads when removing the 21st, 41st, 61st (and etc) request headers. thanks Umesh Sirsiwal for reporting this issue.
** bugfix: [[ngx.log()|http://wiki.nginx.org/HttpLuaModule#ngx.log]] would truncate the log messages which have null characters ({{{\0}}}) in it. thanks Wang Xi for reporting this issue.
** docs: eliminated the use of {{{package.seeall}}} in code samples and also explicitly discouraged the use of it.
** docs: documented the special case that client closes the connection before [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] finishes reading the whole body.
* upgraded HeadersMoreNginxModule to 0.19.
**  bugfix: [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] would result in memory invalid reads when removing the 21st, 41st, 61st (and etc.) request headers. thanks Umesh Sirsiwal for reporting this issue.
** docs: fixed an issue in the sample code that tried to clear {{{Transfer-Encoding}}} which cannot actually be cleared. thanks koukou73gr.
* upgraded LuaRestyStringLibrary to 0.08.
** bugfix: the {{{new()}}} method in the {{{resty.aes}}} module might use a random key when the {{{method}}} option is omitted in the {{{hash}}} table argument. thanks wsser for the patch.
** feature: we now return a second string describing the error when either {{{iv}}} or {{{key}}} is bad.
* bugfix: {{{./configure --with-pcre=PATH}}} did not accept relative paths as {{{PATH}}}. thanks smallfish for reporting this issue.
! Mainline Version 1.2.4.7 - 11 November 2012
* upgraded LuaJIT to 2.0.0rc3.
* upgraded LuaNginxModule to 0.7.4.
** feature: added new directive [[lua_check_client_abort|http://wiki.nginx.org/HttpLuaModule#lua_check_client_abort]] (default to {{{off}}}) for monitoring and processing the event that the client closes the (downstream) connection prematurely. thanks Zhu Dejiang for request this feature.
** feature: added new Lua API [[ngx.on_abort()|http://wiki.nginx.org/HttpLuaModule#ngx.on_abort]] which is used to register user Lua function callback for the event that the client closes the (downstream) connection prematurely. thanks Matthieu Tourne for suggesting this feature.
** feature: [[ngx.exit|http://wiki.nginx.org/HttpLuaModule#ngx.exit]](N) can now abort pending subrequests when {{{N = 408}}} (request time out) or {{{N = 499}}} (client closed request) or {{{N = -1}}} (error).
** bugfix: The TCP/stream cosocket's [[connect()|http://wiki.nginx.org/HttpLuaModule#tcpsock:connect]] method could not detect errors like "connection refused" when kqueue was used (on ~FreeBSD or Mac OS X, for example). thanks smallfish for reporting this issue.
** bugfix: reading operations on [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] did not return any errors when the request body got truncated; now we return the "client aborted" error.
* upgraded LuaRestyDNSLibrary to 0.09.
** refactor: avoided using {{{package.seeall}}} in Lua module definitions, which improves performance and also prevents subtle bad side-effects.
** bugfix: a debugging output might be sent to stdout unexpectedly in some code path.
* upgraded LuaRestyMemcachedLibrary to 0.10.
** refactor: avoided using {{{package.seeall}}} in Lua module definitions, which improves performance and also prevents subtle bad side-effects.
** docs: fixed typos in README. thanks cyberty for the patch.
* upgraded LuaRestyRedisLibrary to 0.15.
** refactor: avoided using {{{package.seeall}}} in Lua module definitions, which improves performance and also prevents subtle bad side-effects.
** optimize: avoided using {{{ipairs()}}} which is slower than plain {{{for i=1,N}}} loops.
* upgraded LuaRestyMySQLLibrary to 0.11.
** refactor: avoided using {{{package.seeall}}} in Lua module definitions, which improves performance and also prevents subtle bad side-effects.
** feature: now the [[new()|https://github.com/agentzh/lua-resty-mysql#new]] method will return a string describing the error as the second return value in case of failures.
* upgraded LuaRestyUploadLibrary to 0.04.
** refactor: avoided using {{{package.seeall}}} in Lua module definitions, which improves performance and also prevents subtle bad side-effects.
* upgraded LuaRestyStringLibrary to 0.07.
** refactor: avoided using {{{package.seeall}}} in Lua module definitions, which improves performance and also prevents subtle bad side-effects.
** docs: typo-fixes in the code samples from Bearnard Hibbins.
* bugfix: nginx upstream modules could not detect the "connection refused" error in time if kqueue was used; now we apply the [[upstream_test_connect_kqueue patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.4-upstream_test_connect_kqueue.patch]] for the Nginx core.
! Mainline Version 1.2.4.5 - 30 October 2012
* applied the official [[hotfix #1 patch|http://luajit.org/download/beta11_hotfix1.patch]] to LuaJIT 2.0.0 beta11.
** see details here: http://www.freelists.org/post/luajit/Hotfix1-for-LuaJIT200beta11
* upgraded LuaNginxModule to 0.7.3.
** feature: added the [[get_keys|http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.get_keys]] method for the shared memory dictionaries for fetching all the (or the specified number of) keys (default to 1024 keys). thanks Brian Akins for the patch.
! Mainline Version 1.2.4.3 - 17 October 2012
* upgraded LuaJIT to 2.0.0 beta11.
** made LuaRestyRedisLibrary 27% faster, LuaRestyMemcachedLibrary 22% faster, and LuaRestyMySQLLibrary 15% faster, all for simple test cases loaded by ab, tested on Linux x86_64.
** all Lua ~APIs involved with I/O in LuaNginxModule are faster in general.
** complete change log: http://luajit.org/changes.html
* upgraded LuaRestyMemcachedLibrary to 0.09.
** optimize: we now use Lua's own {{{table.concat()}}} to do string concatenation for all the memcached requests instead of relying on the [[cosocket API|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]] (on the C level) because calling the Lua C API is much slower especially when LuaJIT is in use. now for simple test cases loaded by {{{ab -k -c10}}}, we get 11.3% overall performance boost.
* upgraded LuaNginxModule to 0.7.2.
** feature: now we can automatically detect the vendor-provided ~LuaJIT-2.0 package on Gentoo. thanks Il'ya V. Yesin for the patch. it is still recommended, however, to explicitly set the environments {{{LUAJIT_INC}}} and {{{LUAJIT_LIB}}}.
! Mainline Version 1.2.4.1 - 14 October 2012
* upgraded the Nginx core to 1.2.4.
** see http://nginx.org/en/CHANGES-1.2 for changes.
* upgraded LuaNginxModule to 0.7.1.
** feature: implemented the "light threads" API, which allows asynchronous concurrent processing within a single Nginx request handler, based on automatically-scheduled Lua coroutines. thanks Lee Holloway for requesting this feature.
*** http://wiki.nginx.org/HttpLuaModule#ngx.thread.spawn
*** http://wiki.nginx.org/HttpLuaModule#ngx.thread.wait
** bugfix: [[ngx.re.gsub()|http://wiki.nginx.org/HttpLuaModule#ngx.re.gsub]] might throw out the exception {{{attempt to call a string value}}} when the {{{replace}}} argument was a Lua function and the subject string was large. thanks Zhu Maohai for reporting this issue.
** bugfix: older gcc versions might issue warnings like {{{variable 'nrets' might be clobbered by 'longjmp' or 'vfork'}}}, like gcc 3.4.3 (for Solaris 11) and gcc 4.1.2 (for Red Hat Linux). thanks Wenhua Zhang for reporting this issue.
** docs: added a warning for [[ngx.var.VARIABLE|http://wiki.nginx.org/HttpLuaModule#ngx.var.VARIABLE]] that memory is allocated in the per-request memory pool. thanks lilydjwg.
** docs: made it clear why {{{return}}} is recommended to be used with [[ngx.exit()|http://wiki.nginx.org/HttpLuaModule#ngx.exit]]. thanks Antoine.
** docs: massive wording improvements from Dayo.
* now we add SrcacheNginxModule before both LuaNginxModule and HeadersMoreNginxModule so that the former's output filter runs //after// those of the latter.

See ChangeLog1002003 for change log for OpenResty 1.2.3.x.
<<toolbar permalink>>
! Mainline Version 1.2.6.6 - 17 February 2013
* upgraded LuaNginxModule to 0.7.15.
** bugfix: the original Lua VM error messages might get lost in case of Lua code crashes when user coroutines were used. thanks Dirk Feytons for the report.
** diagnose: added more info about {{{r->main->count}}} to the debugging logs.
** style: massive coding style fixes according to the Nginx coding style.
The following components are bundled:
* ~LuaJIT-2.0.0
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.4
* echo-nginx-module-0.42
* encrypted-session-nginx-module-0.02
* form-input-nginx-module-0.07
* headers-more-nginx-module-0.19
* iconv-nginx-module-0.10rc7
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.09
* lua-resty-memcached-0.10
* lua-resty-mysql-0.12
* lua-resty-redis-0.15
* lua-resty-string-0.08
* lua-resty-upload-0.07
* memc-nginx-module-0.13rc3
* nginx-1.2.6
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.18
* ngx_lua-0.7.15
* ngx_postgres-1.0rc2
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.09
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.19
* xss-nginx-module-0.03rc9
! Mainline Version 1.2.6.5 - 8 February 2013
* upgraded SrcacheNginxModule to 0.19.
** bugfix: HEAD and conditional GET requests would still fall back to content handler execution (leading to backend accesses) even in case of a cache hit. thanks Wang Lichao for reporting this issue.
** style: massive coding style fixes.
* upgraded LuaRestyUploadLibrary to 0.07.
** bugfix: the boundary string could not be parsed if no space was present before the {{{boundary=xxx}}} parameter in the {{{Content-Type}}} request header. thanks chenshu for reporting this issue.
! Mainline Version 1.2.6.3 - 3 February 2013
* upgraded LuaNginxModule to 0.7.14.
** feature: implemented named subpattern support in [[ngx.re.match|http://wiki.nginx.org/HttpLuaModule#ngx.re.match]], [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]], [[ngx.re.sub|http://wiki.nginx.org/HttpLuaModule#ngx.re.sub]], and [[ngx.re.gsub|http://wiki.nginx.org/HttpLuaModule#ngx.re.gsub]]; also added new regex option {{{D}}} to allow duplicate named subpattern names. thanks Ray Bejjani for the patch.
** feature: implemented the {{{J}}} regex option for the PCRE Javascript compatible mode in the [[ngx.re API|http://wiki.nginx.org/HttpLuaModule#ngx.re.match]]. thanks lhmwzy for requesting this.
** feature: setting [[ngx.header.HEADER|http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER]] after sending out the response headers now only produced an error message in the Nginx error logs and does not throw out a Lua exception. this should be handy for Lua development. thanks Matthieu Tourne for requesting this.
** feature: automatic Lua 5.1 interpreter detection on ~OpenBSD 5.2. thanks Ilya Shipitsin for the patch.
** refactor: when the Nginx core fails to send the "100 Continue" response in case of the "Expect: 100-continue" request header (or just running out of memory), [[ngx.req.read_body()|http://wiki.nginx.org/HttpLuaModule#ngx.req.read_body]] will no longer throw out a "failed to read request body" Lua error but will just terminate the current request and returns the 500 error page immediately, just as what the Nginx core currently does in this case.
** bugfix: because of the recent API behaviour changes in nginx 1.2.6+ and 1.3.9+, the "http request count is zero" alert might happen when [[ngx.req.read_body()|http://wiki.nginx.org/HttpLuaModule#ngx.req.read_body]] was called to read the request body and Nginx failed to send out the "100 Continue" response (like client connection early abortion and etc). thanks stonehuzhan for reporting this issue.
** bugfix: setting the "eof" argument (i.e., {{{ngx.arg[2]}}}) in [[body_filter_by_lua*|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]] for a subrequest could truncate the main request's response data stream.
** bugfix: in [[body_filter_by_lua*|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]], the "eof" argument (i.e., {{{ngx.arg[2]}}}) was never set in Nginx subrequests.
** bugfix: for nginx 1.3.9+ compatibility, we return an error while using [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] to read the chunked request body (for now), because chunked support in the downstream cosocket API is still a TODO.
** bugfix: for nginx 1.3.9+ compatibility, [[rewrite_by_lua*|http://wiki.nginx.org/HttpLuaModule#rewrite_by_lua]] or [[access_by_lua*|http://wiki.nginx.org/HttpLuaModule#access_by_lua]] handlers might hang if the request body was read there, because the Nginx core now overwrites {{{r->write_event_handler}}} to {{{ngx_http_request_empty_handler}}} in its {{{ngx_http_read_client_request_body}}} API.
** bugfix: for nginx 1.3.9+ compatibility, we now throw an error in [[ngx.req.init_body()|http://wiki.nginx.org/HttpLuaModule#ngx.req.init_body]], [[ngx.req.set_body_data()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_data]], and [[ngx.req.set_body_file()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_file]] when calling them without calling [[ngx.req.read_body()|http://wiki.nginx.org/HttpLuaModule#ngx.req.read_body]] or after calling [[ngx.req.discard_body()|http://wiki.nginx.org/HttpLuaModule#ngx.req.discard_body]].
** bugfix: a compilation error would happen when building with an Nginx core patched by the SPDY patch 58_1.3.11 because the patch had removed a request field from the Nginx core. thanks Chris Lea for reporting this.
** bugfix: we did not get the request reference counter (i.e., {{{r->main->count}}}) right when [[lua_need_request_body|http://wiki.nginx.org/HttpLuaModule#lua_need_request_body]] was turned on and nginx versions older than 1.2.6 or 1.2.9 were used.
** optimize: we no longer traverse the captured body chain everytime we append a new link to it in [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]].
** docs: documented the [[ngx.quote_sql_str|http://wiki.nginx.org/HttpLuaModule#ngx.quote_sql_str]] API.
* upgraded SrcacheNginxModule to 0.18.
** bugfix: we might serve a truncated [[srcache_fetch|http://wiki.nginx.org/HttpSRCacheModule#srcache_fetch]] subrequest's response body as the cached response.
* upgraded EchoNginxModule to 0.42.
** feature: the [[echo_after_body|http://wiki.nginx.org/HttpEchoModule#echo_after_body]] directive is now enabled in Nginx subrequests (again).
** bugfix: we did not set the "last_in_chain" buffer flag when [[echo_after_body|http://wiki.nginx.org/HttpEchoModule#echo_after_body]] was used in subrequests.
* upgraded FormInputNginxModule to 0.07.
** bugfix: Nginx might hang when it failed to send the "100 Continue" response for Nginx versions older than 1.2.6 (and those older than 1.3.9 in the 1.3.x series).
* upgraded NginxDevelKit ot 0.2.18.
** bugfix: various fixes for C89 compliance. also stripped some line-trailing spaces.
** bugfix: guard macros were missing in the {{{ndk_set_var.h}}} header file.
** bugfix: the {{{ndk_string}}} submodule failed to compile with gcc 4.6. thanks Jon Kolb for the patch.
** bugfix: the {{{ndk_set_var}}} example did not use the new way in its {{{config}}} file. thanks Amos Wenger for the patch.
** docs: fixes in README to reflect recent changes. thanks Amos Wenger for the patch.
* applied Ruslan Ermilov's [[resolver_wev_handler_segfault_with_poll patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.6-resolver_wev_handler_segfault_with_poll.patch]] to the Nginx core bundled. see [[the related nginx-devel thread|http://mailman.nginx.org/pipermail/nginx-devel/2013-January/003275.html]] for details.
* excluded the [[allow_request_body_updating patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.2.5-allow_request_body_updating.patch]] from the Nginx core bundled.
! Mainline Version 1.2.6.1 - 4 January 2013
* upgraded the Nginx core to 1.2.6.
** see http://nginx.org/en/CHANGES-1.2 for changes.
* upgraded LuaNginxModule to 0.7.13.
** bugfix: [[ngx.decode_args()|http://wiki.nginx.org/HttpLuaModule#ngx.decode_args]] might result in Lua string storage corruption. thanks Xu Jian for the report and Kindy Lin for the patch.
** bugfix: using a key with underscores in [[ngx.header.KEY|http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER]] resulted in Lua string storage corruption. thanks rkearsley for reporting this issue.
** bugfix: accessing [[ngx.var.VARIABLE|http://wiki.nginx.org/HttpLuaModule#ngx.var.VARIABLE]] allocated temporary memory buffers in the request memory pool, which could lead to unnecessarily large memory footprint; now it allocates such buffers via Lua GC.
** feature: automatically detect LuaJIT 2.0 on ~FreeBSD by default. thanks rkearsley for the patch.
** docs: explained why {{{local foo = require "foo"}}} is required for loading a Lua module. thanks rkearsley for asking.
** docs: fixed a typo in the code sample for [[tcpsock:receiveuntil()|http://wiki.nginx.org/HttpLuaModule#tcpsock:receiveuntil]]. thanks Yecheng Fu for the patch.
** docs: fixed a typo in the Lua code sample for [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]] (we forgot to add {{{do}}} there). thanks Guo Yin for reporting this issue.
* upgraded LuaRestyUploadLibrary to 0.06.
** optimize: use the pure lower-case form of the key {{{content-type}}} to index the headers table returned by [[ngx.req.get_headers()|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers]] so as to avoid the overhead of calling the {{{__index}}} metamethod.
* upgraded SrcacheNginxModule to 0.17.
** bugfix: [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]] would emit the misleading error message "srcache_store: skipped because response body truncated: N > 0" for HEAD requests (because a HEAD request's response never carries a body); now it just skips such responses silently. thanks Yang Jin for reporting this issue.
* bugfix: when relative paths were used in {{{--with-zlib=DIR}}}, {{{--with-libatomic=DIR}}}, {{{--with-md5=DIR}}}, and {{{--with-sha1=DIR}}}, the build system of Nginx could not find {{{DIR}}} at all. thanks ~LazyZhu for reporting this issue.

See ChangeLog1002004 for change log for OpenResty 1.2.4.x.
<<toolbar permalink>>
! Stable Release 1.2.7.8 - 13 May 2013
* applied the official patch for the nginx core to address the recent nginx security vulnerability ~CVE-2013-2070.
! Stable Release 1.2.7.6 - 17 April 2013
* upgraded LuaNginxModule to 0.7.21.
** bugfix: boolean values in an array table were rejected with the exception "attempt to use boolean as query arg value" while encoding a Lua (hash) table as URL arguments. thanks Calin Don for reporting this issue.
** bugfix: [[ngx.req.raw_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.raw_header]] would return an empty string value when the default header buffer ({{{c->buffer}}}) can hold the request line but not the whole header. thanks ~KDr2 for reporting this issue.
* upgraded EncryptedSessionNginxModule to 0.03.
** refactor: fixed typos in the source code: replacing "3des" with "aes"; thanks Edgar Liu for reporting this issue.
* upgraded IconvNginxModule to 0.10.
** bugfix: failed to build on Solaris with the bogus error message "ngx_devel_kit is required to build ngx_iconv; please put it before ngx_iconv".
The following components are bundled:
* ~LuaJIT-2.0.1 (with hotfix #1)
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.5
* echo-nginx-module-0.45
* encrypted-session-nginx-module-0.03
* form-input-nginx-module-0.07
* headers-more-nginx-module-0.19
* iconv-nginx-module-0.10
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.09
* lua-resty-memcached-0.11
* lua-resty-mysql-0.13
* lua-resty-redis-0.15
* lua-resty-string-0.08
* lua-resty-upload-0.08
* memc-nginx-module-0.13rc3
* nginx-1.2.7
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.18
* ngx_lua-0.7.21
* ngx_postgres-1.0rc2
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.10
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.19
* xss-nginx-module-0.03rc9
! Mainline Version 1.2.7.5 - 9 April 2013
* upgraded EchoNginxModule to 0.45.
** bugfix: [[$echo_client_request_headers|http://wiki.nginx.org/HttpEchoModule#.24echo_client_request_headers]] would return the first part of the request body when request body was read before reading this variable.
** bugfix: [[$echo_client_request_headers|http://wiki.nginx.org/HttpEchoModule#.24echo_client_request_headers]] might not work properly in a subrequest.
* upgraded DrizzleNginxModule to 0.1.5.
** bugfix: compilation errors occurred with nginx 1.3.15. thanks Karl Blessing for reporting this issue.
** docs: fixed a typo in the sample code for [[$drizzle_thread_id|http://wiki.nginx.org/HttpDrizzleModule#.24drizzle_thread_id]] reported by 岚偑/yy秋叶.
** docs: documented the config syntax for db passwords with special chars in them.
* upgraded LuaNginxModule to 0.7.20.
** feature: now we allow the "0" time argument in [[ngx.sleep()|http://wiki.nginx.org/HttpLuaModule#ngx.sleep]].
** feature: [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]] now return a lua table with the boolean field "truncated", which indicates whether the subrequest response body is truncated.
** bugfix: request hung when rewrite cycled in [[ngx.req.set_uri(uri, true)|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri]] instead of throwing out an error log message and a 500 page properly. thanks Calin Don for the report.
** bugfix: assignment to [[ngx.status|http://wiki.nginx.org/HttpLuaModule#ngx.status]] did not take effect when the response status line had already been generated (by ngx_proxy or others). thanks eqiuno for reporting this issue.
** bugfix: [[ngx.req.raw_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.raw_header]] would return the first part of the request body when request body was read before the call. thanks Matthieu Tourne for reporting this issue.
** bugfix: [[ngx.req.raw_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.raw_header]] might not work properly in a subrequest.
** bugfix: we would override the subrequest response status code later when error happens.
** bugfix: the debug log message "lua set uri jump to <uri>" generated by [[ngx.req.set_uri(uri, true)|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri]] was wrong for "<uri>" was the old URI.
* upgraded LuaRestyMySQLLibrary to 0.13.
** bugfix: 64-bit integer values in the ~MySQL packets (like last insert ids) could not be properly parsed due to the lack of support for 64-bit integers in LuaJIT's standard "bit" module. thanks Azure Wang for the patch implementing a temporary workaround.
** docs: various typo fixes from Tor Hveem and doledoletree.
* upgraded LuaRestyMemcachedLibrary to 0.11.
** feature: added new method "touch" for the new Memcached command "touch". thanks merlin for the patch.
* updated the [[upstream_truncation patch|https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.7-upstream_truncation.patch]] for the Nginx core.
** bugfix: chunked upstream response bodies were treated as 502. thanks Andy Yuan for the report.
** bugfix: request response status was changed to 502 after response header was sent in case of data truncation.
** bugfix: the "last buf" (i.e., bufs with "last_buf" or "last_in_chain" set) should not be sent downstream in case of upstream data truncation.
* updated the [[dtrace patch|https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.7-dtrace.patch]] for the Nginx core.
** feature: made the stap function {{{ngx_chain_dump()}}} print out info about the "last_buf" and "last_in_chain" flags in bufs and removed the old "<eof>" notation in the output.
! Mainline Version 1.2.7.3 - 24 March 2013
* upgraded LuaNginxModule to 0.7.18.
** feature: implemented [[ngx.req.http_version()|http://wiki.nginx.org/HttpLuaModule#ngx.req.http_version]] that returns the HTTP version number for the current request. thanks Matthieu Tourne for requesting this.
** feature: implemented the [[ngx.req.raw_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.raw_header]] function for returning the original raw HTTP protocol header string received by Nginx. thanks Matthieu Tourne for requesting this.
** feature: added new methods [[safe_set|http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.safe_set]] and [[safe_add|http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.safe_add]] to ngx.shared.DICT objects, which never override existing unexpired items but immediately return nil and a "no memory" string message when running out of storage. thanks Matthieu Tourne for requesting this.
** feature: datagram Unix domain sockets created by [[ngx.socket.udp()|http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp]] can now receive data from the other endpoint via "autobind" on Linux. thanks Dirk Feytons for the patch.
** change: the [[ngx.re.match|http://wiki.nginx.org/HttpLuaModule#ngx.re.match]], [[ngx.re.gmatch|http://wiki.nginx.org/HttpLuaModule#ngx.re.gmatch]], [[ngx.re.sub|http://wiki.nginx.org/HttpLuaModule#ngx.re.sub]], and [[ngx.re.gsub|http://wiki.nginx.org/HttpLuaModule#ngx.re.gsub]] functions used to throw Lua exceptions aggressively for all the error conditions; now they just return an additional Lua string describing the error for almost all common errors instead of throwing exceptions, including pcre compile-time and exec-time failures. thanks Matthieu Tourne for requesting this change.
** bugfix: use of [[ngx.req.socket()|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] could make socket reading hang infinitely when the request did not take a request body at all (that is, when the ~Content-Length request header is missing). thanks Matthieu Tourne for reporting this issue.
** bugfix: when a non-table value was specified for the "args" option in the [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] or [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]] call, memory invalid access might happen, which resulted in garbage data at least. thanks Siddon Tang for reporting this issue.
** bugfix: when the Lua code using UDP/TCP cosockets + resolver was run in a subrequest, the subrequest could hang due to missing calls to {{{ngx_http_run_posted_requests}}} in the UDP/TCP cosocket resolver handler. thanks Lanshun Zhou for reporting this issue.
** bugfix: [[ngx.socket.udp|http://wiki.nginx.org/HttpLuaModule#ngx.socket.udp]]: memory leaks or invalid memory accesses might happen when the DNS resolver failed to resolve.
** bugfix: [[rewrite_by_lua_no_postpone|http://wiki.nginx.org/HttpLuaModule#rewrite_by_lua_no_postpone]] can only work globally and did not reject contexts like "server" and "location" configuration blocks. thanks Matthieu Tourne for reporting this issue.
** bugfix: (large) in-file request bodies could not be inherited correctly by multiple subrequests issued by [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]]. thanks Matthieu Tourne for reporting this issue.
** bugfix: [[ngx.req.get_headers(limit, true)|http://wiki.nginx.org/HttpLuaModule#ngx.req.get_headers]] would still return header names in the pure lower-case form when the "limit" argument was an integer. thanks Matthieu Tourne for reporting this issue.
** bugfix: [[ngx.re.match|http://wiki.nginx.org/HttpLuaModule#ngx.re.match]]: when the "D" regular expression option was specified, an empty Lua table would always be created even when the named capture was actually empty. thanks Matthieu Tourne for reporting this issue.
** docs: made it explicit that redirecting to external domains is also supported in [[ngx.redirect()|http://wiki.nginx.org/HttpLuaModule#ngx.redirect]]. thanks Ron Gomes for asking.
* upgraded EchoNginxModule to 0.44.
** bugfix: [[$echo_client_request_headers|http://wiki.nginx.org/HttpEchoModule#.24echo_client_request_headers]] was evaluated to only the last part of the request header when "large header buffers" were used.
** change: preserve the trailing {{{CR LF}}} at the end of the whole HTTP protocol header returned by [[$echo_client_request_headers|http://wiki.nginx.org/HttpEchoModule#.24echo_client_request_headers]].
* upgraded Redis2NginxModule to 0.10.
** feature: allow use of the request body data in Nginx variables for main requests by always reading the request body automatically; we used to always discard the request body just like the standard ngx_memcached module. thanks Ristona Hua for sharing this usage.
** docs: updated the docs for the limitations on Redis pub/sub. thanks ~LazyZhu for pointing out the potential confusions.
** docs: now we recommend LuaRestyRedisLibrary instead when being used with LuaNginxModule.
* upgraded LuaRestyUploadLibrary to 0.08.
** bugfix: when multiple {{{Content-Type}}} request headers were given, a Lua exception would be thrown; now we just pick up the first one.
** docs: better error handling in the code sample. thanks wgm.china for the report.
* feature: applied [[the variables_in_redis_pass patch|https://raw.github.com/agentzh/ngx_openresty/master/patches/ngx_http_redis-0.3.6-variables_in_redis_pass.patch]] to RedisNginxModule 0.3.6 to allow use of Nginx variables in the [[redis_pass|http://wiki.nginx.org/HttpRedisModule#redis_pass]] directive. thanks Diptamay Sanyal for requesting this feature.
* bugfix: applied Lanshun Zhou's [[run_posted_requests_in_resolver patch|https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.7-run_posted_requests_in_resolver.patch]] to the Nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2013-March/003476.html
* bugfix:  applied the official [[hotfix #1 patch|http://luajit.org/download/v2.0.1_hotfix1.patch]] for the bundled LuaJIT 2.0.1.
! Mainline Version 1.2.7.1 - 22 February 2013
* upgraded the Nginx core to 1.2.7.
** see http://nginx.org/en/CHANGES-1.2 for changes.
* upgraded LuaJIT 2.0 to 2.0.1.
** see http://luajit.org/changes.html for changes.
* upgraded LuaNginxModule to 0.7.16.
** optimize: removed the unsed {{{size}}} field and related computatins from the script engine for the {{{ngx.re}}} API.
** optimize: saved a little memory in the script engine for the {{{ngx.re}}} API.
See ChangeLog1002006 for change log for OpenResty 1.2.6.x.
<<toolbar permalink>>
! Stable Release 1.2.8.6 - 10 June 2013
* upgraded LuaJIT to 2.0.2.
** changes: http://luajit.org/changes.html
The following components are bundled:
* ~LuaJIT-2.0.2
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.5
* echo-nginx-module-0.45
* encrypted-session-nginx-module-0.03
* form-input-nginx-module-0.07
* headers-more-nginx-module-0.20
* iconv-nginx-module-0.10
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.09
* lua-resty-memcached-0.11
* lua-resty-mysql-0.13
* lua-resty-redis-0.15
* lua-resty-string-0.08
* lua-resty-upload-0.08
* memc-nginx-module-0.13rc3
* nginx-1.2.8
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.18
* ngx_lua-0.8.2
* ngx_postgres-1.0rc2
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.10
* set-misc-nginx-module-0.22rc8
* srcache-nginx-module-0.21
* xss-nginx-module-0.03rc9
! Mainline Version 1.2.8.5 - 23 May 2013
* upgraded LuaNginxModule to 0.8.2.
** feature: added {{{ngx.HTTP_MKCOL}}}, {{{ngx.HTTP_COPY}}}, {{{ngx.HTTP_MOVE}}}, and other ~WebDAV request method constants; also added corresponding support to [[ngx.req.set_method|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_method]] and [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]]. thanks Adallom Roy for the patch.
** feature: allow injecting new user Lua ~APIs (and overriding existing Lua ~APIs) in the "ngx" table.
** bugfix: [[ngx.req.set_body_file()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_file]] always enabled Direct I/O which caused the alert message "fcntl(~O_DIRECT) ... Invalid argument" in error logs on file systems lacking the Direct I/O support.  thanks Matthieu Tourne for reporting this issue.
** bugfix: buffer corruption might happen in [[ngx.req.set_body_file()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_file]] when Nginx upstream modules were used later because [[ngx.req.set_body_file()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_file]] incorrectly set {{{r->request_body->buf}}} to the in-file buffer which could get reused by {{{ngx_http_upstream}}} for its own purposes.
** bugfix: no longer automatically turn underscores (_) to dashes (-) in header names for [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] and [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]]. thanks aviramc for the report.
** bugfix: segmentation fault might happen in nginx 1.4.x when calling [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] on the {{{Cookie}}} request headers because recent versions of Nginx no longer always initialize {{{r->headers_in.cookies}}}. thanks Rob W for reporting this issue.
** bugfix: fixed the C compiler warning "argument 'nret' might be clobbered by 'longjmp' or 'vfork'" when compiling with Ubuntu 13.04's gcc 4.7.3. thanks jacky and Rajeev's reports.
** bugfix: temporary memory leaks might happen when using [[ngx.escape_uri|http://wiki.nginx.org/HttpLuaModule#ngx.escape_uri]], [[ngx.unescape_uri|http://wiki.nginx.org/HttpLuaModule#ngx.unescape_uri]], [[ngx.quote_sql_str|http://wiki.nginx.org/HttpLuaModule#ngx.quote_sql_str]], [[ngx.decode_base64|http://wiki.nginx.org/HttpLuaModule#ngx.decode_base64]], and [[ngx.encode_base64|http://wiki.nginx.org/HttpLuaModule#ngx.encode_base64]] in tight Lua loops because we allocated memory in nginx's request memory pool for these methods.
** optimize: [[ngx.escape_uri|http://wiki.nginx.org/HttpLuaModule#ngx.escape_uri]] now runs faster when the input string contains no special bytes to be escaped.
** testing: added custom test scaffold t::~TestNginxLua which subclasses [[Test::Nginx::Socket|http://search.cpan.org/perldoc?Test%3A%3ANginx%3A%3ASocket]]. it supports the environment {{{TEST_NGINX_INIT_BY_LUA}}} which can be used to add more custom Lua code to the value of the [[init_by_lua|http://wiki.nginx.org/HttpLuaModule#init_by_lua]] directive in the Nginx configuration.
* upgraded SrcacheNginxModule to 0.21.
** bugfix: responses with a status code smaller than all the status codes specified in the [[srcache_store_statuses|http://wiki.nginx.org/HttpSRCacheModule#srcache_store_statuses]] directive were not skipped as expected. thanks Lanshun Zhou for the patch.
* feature: applied the [[invalid_referer_hash patch|https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.8-invalid_referer_hash.patch]] to the Nginx core to make the {{{$invalid_referer}}} variable accessible in embedded dynamic languages like Perl and Lua. thanks Fry-kun for requesting this.
* updated the [[dtrace patch|https://raw.github.com/agentzh/ngx_openresty/master/patches/nginx-1.2.8-dtrace.patch]] for the Nginx core.
** print out more info about the Nginx in-file bufs in the tapset function {{{ngx_chain_dump}}}.
! Mainline Version 1.2.8.3 - 13 May 2013
* applied the official patch for the nginx core to address the recent nginx security vulnerability ~CVE-2013-2070.
! Mainline Version 1.2.8.1 - 26 April 2013
* upgraded the Nginx core to 1.2.8.
** see http://nginx.org/en/CHANGES-1.2 for changes.
* upgraded LuaNginxModule to 0.8.1.
** feature: implemented the new timer API: the [[ngx.timer.at|http://wiki.nginx.org/HttpLuaModule#ngx.timer.at]] Lua function and two configure directives [[lua_max_pending_timers|http://wiki.nginx.org/HttpLuaModule#lua_max_pending_timers]] and [[lua_max_running_timers|http://wiki.nginx.org/HttpLuaModule#lua_max_running_timers]]. thanks Matthieu Tourne for requesting this feature.
** feature: added the "U" regex option to the [[ngx.re API|http://wiki.nginx.org/HttpLuaModule#ngx.re.match]] to mean enabling the ~UTF-8 matching mode but disabling ~UTF-8 validity check on the subject strings. thanks Lance Li for the patch.
** bugfix: setting [[ngx.header.etag|http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER]] could not affect other things reading the {{{ETag}}} response header (like the [[etag|http://nginx.org/en/docs/http/ngx_http_core_module.html#etag]] directive introduced in Nginx 1.3.3+). thanks Brian Akins for the patch.
** bugfix: when [[lua_http10_buffering|http://wiki.nginx.org/HttpLuaModule#lua_http10_buffering]] is on, for HTTP 1.0 requests, [[ngx.exit|http://wiki.nginx.org/HttpLuaModule#ngx.exit]](N) would always trigger the Nginx's own error pages when N >= 300. thanks Matthieu Tourne for reporting this issue.
** bugfix: modifying the {{{Cookie}}} request headers via [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] or [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not update the Nginx internal data structure, {{{r->headers_in.cookies}}}, at the same time, which might cause issues when reading variables [[$cookie_COOKIE|http://wiki.nginx.org/HttpCoreModule#.24cookie_COOKIE]], for example. thanks Matthieu Tourne for the patch.
** bugfix: modifying the {{{Via}}} request header with [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] or [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not update the special field {{{r->headers_in.via}}} when the [[ngx_gzip|http://wiki.nginx.org/HttpGzipModule]] module was enabled.
** bugfix: modifying the {{{X-Real-IP}}} request header with [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] or [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not update the special field {{{r->headers_in.x_real_ip}}} when the [[ngx_realip|http://wiki.nginx.org/HttpRealipModule]] module was enabled. thanks Matthieu Tourne for the patch.
** bugfix: modifying the {{{Connection}}} request header via [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] or [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not update the special internal field in the Nginx core, {{{r->headers_in.connection_type}}}. Thanks Matthieu Tourne for the patch.
** bugfix: modifying the {{{User-Agent}}} request header via [[ngx.req.set_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] or [[ngx.req.clear_header|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] did not update those special internal flags in the Nginx core, like {{{r->headers_in.msie6}}} and {{{r->headers_in.opera}}}. Thanks Matthieu Tourne for the patch.
** bugfix: fixed several places in the header API where we should return {{{NGX_ERROR}}} instead of {{{NGX_HTTP_INTERNAL_SERVER_ERROR}}}.
* upgraded SrcacheNginxModule to 0.20.
** bugfix: use of C global variables at the configuration phase would cause troubles when {{{HUP}}} reload failed.
* upgraded HeadersMoreNginxModule to 0.20.
** bugfix: modifying the {{{Cookie}}} request headers via [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] or [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not update the Nginx internal data structure, {{{r->headers_in.cookies}}}, at the same time, which might cause issues when reading variable [[$cookie_COOKIE|http://wiki.nginx.org/HttpCoreModule#.24cookie_COOKIE]], for example.
** bugfix: modifying the {{{Via}}} request header via [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] or [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not update the special internal field in the Nginx core, {{{r->headers_in.via}}}, when the [[ngx_gzip|http://wiki.nginx.org/HttpGzipModule]] module was enabled.
** bugfix: modifying the {{{X-Real-IP}}} request header via [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] or [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not update the special internal field in the Nginx core, {{{r->headers_in.x_real_ip}}}, when the [[ngx_realip|http://wiki.nginx.org/HttpRealipModule]] module was enabled.
** bugfix: modifying the {{{Connection}}} request header via [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] or [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not update the special internal field in the Nginx core, {{{r->headers_in.connection_type}}}.
** bugfix: modifying the {{{User-Agent}}} request header via [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] or [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] did not update those special internal flags in the Nginx core, like {{{r->headers_in.msie6}}} and {{{r->headers_in.opera}}}.
** bugfix: fixed places where we should return {{{NGX_ERROR}}} instead of {{{NGX_HTTP_INTERNAL_SERVER_ERROR}}}.
* feature: always enable debuginfo in the bundled LuaJIT 2.0.1 build and Lua 5.1.5 build to support [[Nginx Systemtap Toolkit|https://github.com/agentzh/nginx-systemtap-toolkit]].
* bugfix: no longer pass {{{-O0}}} to gcc when the {{{--with-debug}}} configure option is specified because gcc often generates bogus DWARF info when optimization is turned off.
See ChangeLog1002007 for change log for OpenResty 1.2.7.x.
<<toolbar permalink>>
! Mainline Version 1.4.1.3 - 6 August 2013
* upgraded LuaNginxModule to 0.8.6.
** feature: added new method [[get_stale|http://wiki.nginx.org/HttpLuaModule#ngx.shared.DICT.get_stale]] to shared dict objects, which returns the value (if not freed yet) even if the key has already expired. thanks Matthieu Tourne for the patch.
** bugfix: segfaults would happen in [[ngx.req.set_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_header]] and [[ngx.req.clear_header()|http://wiki.nginx.org/HttpLuaModule#ngx.req.clear_header]] for HTTP 0.9 requests. thanks Bin Wang for the report.
** bugfix: segfault might happen when reading or writing to a response header via the [[ngx.header.HEADER|http://wiki.nginx.org/HttpLuaModule#ngx.header.HEADER]] API in the case that the nginx core initiated a 301 (auto) redirect. this issue was caused by an optimization in the Nginx core where {{{ngx_http_core_find_config_phase}}}, for example, does not fully initialize the "Location" response header after creating the header. thanks Vladimir Protasov for the report.
** bugfix: memory leak would happen when using the [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]] API before another Nginx module (other than LuaNginxModule) initiates an internal redirect.
** bugfix: use of the [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]] table in the context of [[ngx.timer|http://wiki.nginx.org/HttpLuaModule#ngx.timer.at]] callbacks would leak memory.
** bugfix: the "connect() failed" error message was still logged even when [[lua_socket_log_errors|http://wiki.nginx.org/HttpLuaModule#lua_socket_log_errors]] was off. thanks Dong Fang Fan for the report.
** bugfix: we incorrectly returned the 500 error code in our output header filter, body filter, and log-phase handlers upon Lua code loading errors.
** bugfix: Lua stack overflow might happen when we failed to load Lua code from the code cache.
** bugfix: the error message was misleading when the {{{*_by_lua_file}}} config directives failed to load the Lua file specified.
** bugfix: give the argument of 'void' to function definitions which has no arguments. thanks Tatsuhiko Kubo for the patch.
** bugfix: when our {{{at-panic}}} handler for Lua VM gets called, the Lua VM is not recoverable for future use. so now we try to quit the current Nginx worker gracefully so that the Nginx master can spawn a new one.
* upgraded HeadersMoreNginxModule to 0.22.
** bugfix: segfaults would happen in [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] and [[more_clear_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_input_headers]] when processing HTTP 0.9 requests. thanks Bin Wang for the patch.
** bugfix: segfault might happen when using [[more_set_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_headers]] or [[more_clear_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_clear_headers]] in the case that the Nginx core initiated a 301 (auto) redirect. this issue was caused by an optimization in the Nginx core where {{{ngx_http_core_find_config_phase}}}, for example, does not fully initialize the "Location" response header after creating the header. thanks Brian Akins for the report.
* upgraded SrcacheNginxModule to 0.22.
** bugfix: we did not always read the client request body before initiating [[srcache_fetch|http://wiki.nginx.org/HttpSRCacheModule#srcache_fetch]] subrequests at the "access phase", which could lead to bad consequences.
* upgraded EchoNginxModule to 0.46.
** bugfix: the request body was not discarded properly in the content handler when the request body was not read yet. thanks Peter Sabaini for the report.
** bugfix: we did not ensure that the main request body is always read before subrequests are initiated, which could lead to bad consequences.
** bugfix: [[$echo_client_request_headers|http://wiki.nginx.org/HttpEchoModule#.24echo_client_request_headers]] may evaluate to an empty value when the default header buffer ({{{c->buffer}}}) can hold the request line but not the whole header. thanks ~KDr2 for reporting this issue.
** docs: fixed a typo in Synopsis reported by saighost.
** docs: use https for github links. thanks Olivier Mengué for the patch.
* upgraded PostgresNginxModule to 1.0rc3.
** bugfix: compilation error happened with nginx 1.5.3+ because the Nginx core changes the {{{ngx_sock_ntop}}} API. thanks an0ma1ia for the report.
! Mainline Version 1.4.1.1 - 18 July 2013
* upgraded the Nginx core to 1.4.1.
** see http://nginx.org/en/CHANGES-1.4 for changes.
* bugfix: ./configure: use of spaces in the {{{--with-cc}}} option values resulted in errors.
* bugfix: applied the [[unix_socket_accept_over_read patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.1-unix_socket_accept_over_read.patch]] to fix a buffer over-read issue in  the Nginx core when Nginx is configured to listen on a unix domain socket.
* bugfix: applied the [[gcc-maybe-uninitialized-warning patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.1-gcc-maybe-uninitialized-warning.patch]] to the Nginx core to fix a gcc warning with gcc 4.7.3/4.7.2.
* upgraded LuaNginxModule to 0.8.5.
** change: made [[ngx.say|http://wiki.nginx.org/HttpLuaModule#ngx.say]]/[[ngx.print|http://wiki.nginx.org/HttpLuaModule#ngx.print]]/[[ngx.eof|http://wiki.nginx.org/HttpLuaModule#ngx.eof]]/[[ngx.flush|http://wiki.nginx.org/HttpLuaModule#ngx.flush]]/[[ngx.send_headers|http://wiki.nginx.org/HttpLuaModule#ngx.send_headers]] return {{{nil}}} and a string describing the error in case of most of the common errors (instead of throwing out an exception), and return 1 for success.
** feature: added new directive [[lua_regex_match_limit|http://wiki.nginx.org/HttpLuaModule#lua_regex_match_limit]] for setting PCRE's "match_limit" protection for regex execution.
** feature: now we store the nginx request object as a named Lua global variable {{{__ngx_req}}} to help ~FFI-based Lua code directly access it.
** bugfix: the [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]] tables would leak memory when [[ngx.ctx|http://wiki.nginx.org/HttpLuaModule#ngx.ctx]], [[ngx.exec()|http://wiki.nginx.org/HttpLuaModule#ngx.exec]]/[[ngx.req.set_uri|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_uri]](uri, true), and [[log_by_lua|http://wiki.nginx.org/HttpLuaModule#log_by_lua]] were used together in a single location. thanks Guanlan Dai for writing the gdb utils to catch this.
** bugfix: setting [[ngx.var.VARIABLE|http://wiki.nginx.org/HttpLuaModule#ngx.var.VARIABLE]] could lead to buffer over-read in {{{luaL_error}}} when an error happened.
** bugfix: [[tcpsock:send|http://wiki.nginx.org/HttpLuaModule#tcpsock:send]]("") resulted in the error log alert message "send() returned zero".
** bugfix: [[ngx.flush|http://wiki.nginx.org/HttpLuaModule#ngx.flush]](true) might not return 1 on success.
** bugfix: when compiling with {{{-DDDEBUG=1}}}, there was a compilation error. thanks tigeryang for the report.
** optimize: avoided use of the nginx request objects in [[ngx.escape_uri|http://wiki.nginx.org/HttpLuaModule#ngx.escape_uri]], [[ngx.unescape_uri|http://wiki.nginx.org/HttpLuaModule#ngx.unescape_uri]], [[ngx.quote_sql_str|http://wiki.nginx.org/HttpLuaModule#ngx.quote_sql_str]], [[ngx.decode_base64|http://wiki.nginx.org/HttpLuaModule#ngx.decode_base64]], [[ngx.encode_base64|http://wiki.nginx.org/HttpLuaModule#ngx.encode_base64]], [[ngx.encode_args|http://wiki.nginx.org/HttpLuaModule#ngx.encode_args]], and [[ngx.decode_args|http://wiki.nginx.org/HttpLuaModule#ngx.decode_args]].
** optimize: no longer store {{{cf->log}}} into the Lua registry table because we can always directly access the global {{{ngx_cycle->log}}} thing.
** refactor: added inline functions {{{ngx_http_lua_get_req}}} and {{{ngx_http_lua_set_req}}} to eliminate code duplication when storing or fetching the nginx request object from the lua global variable table.
** docs: typo fixes in the code sample for [[body_filter_by_lua|http://wiki.nginx.org/HttpLuaModule#body_filter_by_lua]]. thanks cyberty for the patch.
** docs: mentioned my [[Nginx Systemtap Toolkit|https://github.com/agentzh/nginx-systemtap-toolkit]] which is very useful for online debugging on Linux.
* upgraded HeadersMoreNginxModule to 0.21.
** bugfix: segmentation fault might happen in Nginx 1.4.x when using the [[more_set_input_headers|http://wiki.nginx.org/HttpHeadersMoreModule#more_set_input_headers]] directive on the Cookie request headers because recent versions of Nginx no longer always initialize {{{r->headers_in.cookies}}}.
See ChangeLog1002008 for change log for OpenResty 1.2.8.x.
<<toolbar permalink>>
! Mainline Version 1.4.2.9 - 29 September 2013
* bundled the new LuaRestyWebSocketLibrary 0.01.
** this Lua library implements both a nonblocking ~WebSocket server and a nonblocking ~WebSocket client based on LuaNginxModule's cosocket API. thanks Hendrik Schumacher.
* bundled the new LuaRestyLockLibrary 0.01.
** this Lua library implements a simple nonblocking mutex lock API based on LuaNginxModule's shared memory dictionaries. Mostly useful for eliminating "dog-pile effects" and etc. thanks Sri Rao for the suggestion.
* upgraded LuaRestyRedisLibrary to 0.16.
** feature: added new redis commands bitcount, bitop, client, dump, hincrbyfloat, incrbyfloat, migrate, pexpire, pexpireat, psetex, pubsub, pttl, restore, and time. thanks alex-yam for the patch.
** optimize: eliminated the [[table.insert()|http://www.lua.org/manual/5.1/manual.html#pdf-table.insert]] calls because they are slower than {{{tb[#tb + 1] = val}}}. thanks alex-yam for the patch. this gives 1.9% speed up for trivial set and get examples when LuaJIT 2.0.2 is used and 4.9% speed up when LuaJIT's v2.1 git branch is used.
** refactor: avoided using Lua 5.1's [[module() function|http://www.lua.org/manual/5.1/manual.html#pdf-module]] for defining our Lua modules because it has bad side effects.
** docs: do not use 0 (i.e., unlimited) max idle time in the [[set_keepalive()|https://github.com/agentzh/lua-resty-redis#set_keepalive]] call in the code sample.
** docs: added code samples for the redis commands {{{hmget}}} and {{{hmset}}}. this has already become a FAQ.
** docs: added the [[Redis Authentication|https://github.com/agentzh/lua-resty-redis#redis-authentication]] section because it is already an FAQ.
** docs: documented the {{{options}}} table argument for the [[connect() method|https://github.com/agentzh/lua-resty-redis#connect]].
** docs: added a missing {{{local}}} keyword to the code sample. thanks Wendal Chen for the patch.
* upgraded LuaRestyMemcachedLibrary to 0.12.
** optimize: no longer use Lua tables and [[table.concat()|http://www.lua.org/manual/5.1/manual.html#pdf-table.concat]] to construct simple Memcached query strings. this gives 6.75% overall speed up for trivial {{{set}}} and {{{get}}} examples when LuaJIT 2.0.2 is used.
** optimize: eliminated [[table.insert()|http://www.lua.org/manual/5.1/manual.html#pdf-table.insert]] because it is slower than {{{tb[#tb + 1] = val}}}.
** refactor: avoided using Lua's [[module() function|http://www.lua.org/manual/5.1/manual.html#pdf-module]] for defining our Lua modules because it has bad side effects.
** docs: use limited (10 sec) max idel timeout for in-pool connections in the code sample.
* upgraded LuaNginxModule to 0.9.0.
** feature: added support for raw downstream cosocket via the [[ngx.req.socket(true)|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]] API, upon which http upgrading protocols like ~WebSocket can be implemented with pure Lua (see LuaRestyWebSocketLibrary). This API can also be used to bypass the Nginx output filters and emit raw HTTP response headers and/or HTTP response bodies. thanks Hendrik Schumacher and aviramc.
** bugfix: memory invalid reads might happen when [[ngx.flush(true)|http://wiki.nginx.org/HttpLuaModule#ngx.flush]] was used: the "ctx" struct could get freed in the middle of processing and we should save the state explicitly on the C stack.
** bugfix: the standard Lua coroutine API was not available in the context of [[init_by_lua*|http://wiki.nginx.org/HttpLuaModule#init_by_lua]] and threw out the "no request found" error. thanks Wolf Tivy for the report.
** bugfix: massive compatibility fixes for the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report and jinglong for the patch for the LuaJIT/Lua bytecode loader.
** bugfix: Lua VM might run out of memory when {{{lua_code_cache}}} is off; now we always enforce a full Lua GC cycle right after unloading most of the loaded Lua modules when the Lua code cache is turned off.
** change: raised the "lua_code_cache is off" warning to an alert.
* upgraded NginxDevelKit to 0.2.19.
** bugfix: fixed warnings from the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report.
! Stable Version 1.4.2.8 - 22 September 2013
* upgraded LuaNginxModule to 0.8.10.
** bugfix: we did not declare the "level" local variable of {{{ngx_http_lua_ngx_log}}} at the beginning of the code block. thanks Edwin Cleton for the report.
** docs: documented more limitations in the current implementation.
** docs: avoided using [[module()|http://www.lua.org/manual/5.1/manual.html#pdf-module]] and also recommended the [[lua-releng tool|https://github.com/agentzh/nginx-devel-utils/blob/master/lua-releng]] to locate misuse of Lua globals.
The following components are bundled in this release:
* ~LuaJIT-2.0.2
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.6
* echo-nginx-module-0.48
* encrypted-session-nginx-module-0.03
* form-input-nginx-module-0.07
* headers-more-nginx-module-0.22
* iconv-nginx-module-0.10
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.10
* lua-resty-memcached-0.11
* lua-resty-mysql-0.13
* lua-resty-redis-0.15
* lua-resty-string-0.08
* lua-resty-upload-0.08
* memc-nginx-module-0.13
* nginx-1.4.2
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.18
* ngx_lua-0.8.10
* ngx_postgres-1.0rc3
* rds-csv-nginx-module-0.05rc2
* rds-json-nginx-module-0.12rc10
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.10
* set-misc-nginx-module-0.22
* srcache-nginx-module-0.22
* xss-nginx-module-0.03rc9
! Mainline Version 1.4.2.7 - 15 September 2013
* upgraded LuaNginxModule to 0.8.9.
** bugfix: the Nginx core does not send a default status line for the 101 status code. now we construct one ourselves in this case.
** bugfix: nil "pool" option values led to errors in [[tcpsock:connect()|http://wiki.nginx.org/HttpLuaModule#tcpsock:connect]].
** bugfix: [[tcpsock:receive(0)|http://wiki.nginx.org/HttpLuaModule#tcpsock:receive]] could hang until new data arrived or the timeout error happened; now it always returns an empty string immediately. this new behaviour diverges from the [[LuaSocket library|http://w3.impa.br/~diego/software/luasocket/]] though.
** bugfix: for SPDY requests, we (temporarily) disable the Lua API functions [[ngx.location.capture|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]], [[ngx.location.capture_multi|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]], and [[ngx.req.socket|http://wiki.nginx.org/HttpLuaModule#ngx.req.socket]], which are known to have problems in SPDY mode. The SPDY compatibility issue will eventually get fixed in the near future.
** refactor: removed our own {{{ctx->headers_sent}}} field because we should use Nginx core's {{{r->header_sent}}} instead.
* upgraded EchoNginxModule to 0.48.
** refactor: removed our own {{{ctx->headers_sent}}} field because we should use Nginx core's {{{r->header_sent}}} instead.
* bugfix: {{{./configure}}} now always removes existing Makefile before trying to generate a new one.
! Mainline Version 1.4.2.5 - 8 September 2013
* upgraded SetMiscNginxModule to 0.22.
** bugfix: we did not escape {{{\0}}}, {{{\z}}}, {{{\b}}}, and {{{\t}}} properly in set_quote_sql_str according to the ~MySQL quoting rules. thanks Siddon Tang for the report.
* upgraded LuaNginxModule to 0.8.8.
** feature: added new option "always_forward_body" to [[ngx.location.capture()|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture]] and [[ngx.location.capture_multi()|http://wiki.nginx.org/HttpLuaModule#ngx.location.capture_multi]], which controls whether to always forward the parent request's request body to the subrequest (even when the subrequest is not of the POST or PUT request method). thanks Matthieu Tourne for the request.
** feature: now timeout errors in [[tcpsock:receive()|http://wiki.nginx.org/HttpLuaModule#tcpsock:receive]] and [[tcpsock:receiveuntil()|http://wiki.nginx.org/HttpLuaModule#tcpsock:receiveuntil]] no longer automatically close the current cosocket object (for both upstream and downstream connections). thanks Aviram Cohen for the original patch.
** bugfix: we did not escape {{{\0}}}, {{{\z}}}, {{{\t}}}, and {{{\b}}} properly in [[ngx.quote_sql_str()|http://wiki.nginx.org/HttpLuaModule#ngx.quote_sql_str]]. thanks Siddon Tang for the report.
** bugfix: Lua backtrace dumps upon uncaught Lua exceptions did not work with the standard Lua 5.1 interpreter when the backtrace was deeper than 22 levels.
** change: now we just dump the top 22 levels in the backtrace for uncaught Lua exceptions for the sake of simplicity.
** change: we now limit the number of nested coroutines in the backtrace dump for uncaught Lua exceptions by 5.
** optimize: grouped the Lua string concatenation operations when constructing the backtrace string for uncaught Lua exceptions.
! Mainline Version 1.4.2.3 - 2 September 2013
* upgraded LuaNginxModule to 0.8.7.
** feature: [[log_by_lua*|http://wiki.nginx.org/HttpLuaModule#log_by_lua]] now always runs before the standard [[ngx_http_log_module|http://nginx.org/en/docs/http/ngx_http_log_module.html]] (for access logging). thanks Calin Don for the suggestion.
** feature: added new API [[ngx.config.debug|http://wiki.nginx.org/HttpLuaModule#ngx.config.debug]] to indicate whether this is a debug build of Nginx (that is, being built by the {{{./configure}}} option {{{--with-debug}}}).
** bugfix: the global Lua state's {{{_G}}} table was cleared when [[lua_code_cache|http://wiki.nginx.org/HttpLuaModule#lua_code_cache]] was off, which could confuse the setup in [[init_by_lua*|http://wiki.nginx.org/HttpLuaModule#init_by_lua]]. thanks Robert Andrew Ditthardt for the report.
** bugfix: [[ngx.flush()|http://wiki.nginx.org/HttpLuaModule#ngx.flush]] triggered response header sending when the header was not sent yet. now it just returned the error string "nothing to flush" for this case. thanks linbo liao for the report.
** bugfix: when a Lua line comment was used in the last line of the inlined Lua code chunk, a bogus Lua syntax error would be thrown.
** bugfix: [[ngx.exit|http://wiki.nginx.org/HttpLuaModule#ngx.exit]](204) could try to send the response header twice. Nginx 1.5.4 caught this issue.
** bugfix: the error message for failures in loading inlined Lua code was misleading.
* upgraded EchoNginxModule to 0.47.
** bugfix: use of C global variables at configuration time could lead to issues when HUP reload failed in the middle.
** bugfix: we might send the response header twice when an error happens. this issue is exposed by Nginx 1.5.4. thanks Markus Linnala for the report.
* upgraded DrizzleNginxModule to 0.1.6.
** bugfix: compilation error happened with nginx 1.5.3+ because Nginx changes the {{{ngx_sock_ntop}}} API.
** docs: typo fixes from smallfish.
* upgraded MemcNginxModule to 0.13.
** bugfix: fixed compatibility issues with the new upstream C API in Nginx 1.5.3+. thanks Markus Linnala for the patch.
** bugfix: use of C global variables at configuration time could cause issues when HUP reload failed in the middle.
** docs: now we recommend LuaRestyMemcachedLibrary instead when being used with LuaNginxModule.
* applied the [[unix_socket_accept_over_read patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.2-unix_socket_accept_over_read.patch]] the Nginx core to fix a memory over-read issue when Nginx was accepting a unix domain socket.
! Mainline Version 1.4.2.1 - 11 August 2013
* upgraded the Nginx core to 1.4.2.
** see http://nginx.org/en/CHANGES-1.4 for changes.
* upgraded LuaRestyDNSLibrary to 0.10.
** feature: now we return all the answer records even when the DNS server returns a non-zero error code, in which case the error code and error string are now set as the "errcode" and "errstr" fields in the Lua table returned. thanks Matthieu Tourne for requesting this.
See ChangeLog1004001 for change log for OpenResty 1.4.1.x.
<<toolbar permalink>>
! Mainline Version 1.4.3.9 - 14 December 2013
* bugfix: the include path for LuaJIT C headers was still pointing to {{{luajit-2.0}}}, which should have been {{{luajit-2.1}}} instead. thanks Tor Hveem for the report.
! Mainline Version 1.4.3.7 - 14 December 2013
* upgraded LuaJIT to v2.1-20131211.
** see changes here: https://github.com/agentzh/luajit2/commits/v2.1-agentzh
* bundled LuaRestyCoreLibrary 0.0.2.
** this library reimplements LuaNginxModule's Lua API with LuaJIT FFI. see https://github.com/agentzh/lua-resty-core for more details.
* upgraded LuaNginxModule to 0.9.3.
** feature: added a lot of pure C API (without using any Lua VM's C API) for ~FFI-based Lua API implementations like LuaRestyCoreLibrary.
** feature: allow creating 0-delay timers upon worker process existing.
** feature: added new API function [[ngx.worker.exiting()|https://github.com/chaoslawful/lua-nginx-module#ngxworkerexiting]] for testing if the current worker process has started exiting.
** feature: [[ngx.re.find()|https://github.com/chaoslawful/lua-nginx-module#ngxrefind]] now accepts the optional 5th argument "nth" to control which submatch capture's indexes are returned. thanks Lance Li for the feature request.
** feature: added new API for version numbers of both Nginx and LuaNginxModule itself: [[ngx.config.nginx_version|https://github.com/chaoslawful/lua-nginx-module#ngxconfignginx_version]] and [[ngx.config.ngx_lua_version|https://github.com/chaoslawful/lua-nginx-module#ngxconfigngx_lua_version]]. thanks smallfish for the patch.
** feature: added support for loading LuaJIT 2.1 bytecode files directly in {{{*_by_lua_file}}} configuration directives.
** bugfix: [[ngx.req.set_header()|https://github.com/chaoslawful/lua-nginx-module#ngxreqset_header]] did not completely override the existing request header with multiple values. thanks Aviram Cohen for the report.
** bugfix: modifying request headers in a subrequest could lead to assertion failures and crashes. thanks leaf corcoran for the report.
** bugfix: turning off [[lua_code_cache|https://github.com/chaoslawful/lua-nginx-module#lua_code_cache]] could lead to memory issues (segfaults and LuaJIT assertion failures) when Lua libraries using LuaJIT FFI were used. now we always create a clean separate Lua VM instance for every Nginx request served by us when the Lua code cache is disabled. thanks Ron Gomes for the report.
** bugfix: the linker option {{{-E}}} is not support in Cygwin's linker; we should test {{{--export-all-symbols}}} at the same time. thanks Heero Zhang for the report.
** bugfix: fixed the warnings from the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report.
** optimize: optimized the implementation of [[ngx.headers_sent|https://github.com/chaoslawful/lua-nginx-module#ngxheaders_sent]] a bit.
** doc: added new section "Statically Linking Pure Lua Modules": https://github.com/chaoslawful/lua-nginx-module#statically-linking-pure-lua-modules
** doc: typo fixes from Zheng Ping.
* upgraded HeadersMoreNginxModule to 0.24.
** bugfix: [[more_set_input_headers|https://github.com/agentzh/headers-more-nginx-module#more_set_input_headers]] did not completely override the existing request header with multiple values. thanks Aviram Cohen for the report.
* upgraded SetMiscNginxModule to 0.23.
** feature: added new configuration directives [[set_formatted_gmt_time|https://github.com/agentzh/set-misc-nginx-module#set_formatted_gmt_time]] and [[set_formatted_local_time|https://github.com/agentzh/set-misc-nginx-module#set_formatted_local_time]]. thanks Trurl ~McByte for the patch.
* upgraded MemcNginxModule to 0.14.
** feature: added new configuration directive [[memc_ignore_client_abort|https://github.com/agentzh/memc-nginx-module#memc_ignore_client_abort]]. thanks Eldar Zaitov for the patch.
* upgraded RdsJsonNginxModule to 0.13.
** bugfix: fixed the warnings from the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report.
* upgraded EchoNginxModule to 0.50.
** bugfix: fixed the warnings from the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report.
* upgraded ArrayVarNginxModule to 0.03.
** bugfix: fixed the warnings from the Microsoft Visual C++ compiler. thanks Edwin Cleton for the report.
* upgraded RedisNginxModule module to 0.3.7.
** see changes here: http://mailman.nginx.org/pipermail/nginx/2013-December/041297.html
* feature: applied the [[larger_max_error_str patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.3-larger_max_error_str.patch]] to the nginx core to allow error log messages up to 4096 bytes and to allow the C macro {{{NGX_MAX_ERROR_STR}}} to be overridden from the outside.
* feature: added new configure option {{{--with-pcre-conf-opt=OPTIONS}}} to the nginx core to allow custom PCRE ./configure build options. thanks Lance Li for the original patch.
! Stable Version 1.4.3.6 - 20 November 2013
* bugfix: applied the official patch [[patch.2013.space.txt|http://nginx.org/download/patch.2013.space.txt]] for the Nginx core to fix the security issue ~CVE-2013-4547.
! Stable Version 1.4.3.4 - 12 November 2013
This release is essentially the same as the last mainline release, 1.4.3.3.

The following components are bundled in this release:
* ~LuaJIT-2.0.2
* array-var-nginx-module-0.03rc1
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.6
* echo-nginx-module-0.49
* encrypted-session-nginx-module-0.03
* form-input-nginx-module-0.07
* headers-more-nginx-module-0.23
* iconv-nginx-module-0.10
* lua-5.1.5
* lua-cjson-1.0.3
* lua-rds-parser-0.05
* lua-redis-parser-0.10
* lua-resty-dns-0.10
* lua-resty-lock-0.01
* lua-resty-memcached-0.12
* lua-resty-mysql-0.14
* lua-resty-redis-0.17
* lua-resty-string-0.08
* lua-resty-upload-0.09
* lua-resty-websocket-0.02
* memc-nginx-module-0.13
* nginx-1.4.3
* ngx_coolkit-0.2rc1
* ngx_devel_kit-0.2.19
* ngx_lua-0.9.2
* ngx_postgres-1.0rc3
* rds-csv-nginx-module-0.05
* rds-json-nginx-module-0.12
* redis-nginx-module-0.3.6
* redis2-nginx-module-0.10
* set-misc-nginx-module-0.22
* srcache-nginx-module-0.24
* xss-nginx-module-0.04
! Mainline Version 1.4.3.3 - 6 November 2013
* upgraded LuaNginxModule to 0.9.2.
** feature: added new API function [[ngx.re.find()|https://github.com/chaoslawful/lua-nginx-module#ngxrefind]], which is similar to [[ngx.re.match|https://github.com/chaoslawful/lua-nginx-module#ngxrematch]], but only returns the beginning index and end index (1-based) of the whole match, which is 30% ~ 40% faster than {{{ngx.re.match}}} for simplest regexes.
** feature: added new API function [[ngx.config.prefix()|https://github.com/chaoslawful/lua-nginx-module#ngxconfigprefix]] to return the Nginx server "prefix" path.
** bugfix: reading [[ngx.header.HEADER|https://github.com/chaoslawful/lua-nginx-module#ngxheaderheader]] could result in Lua string storage corruptions. thanks Dane Knecht for the report.
** bugfix: [[ngx.re.match|https://github.com/chaoslawful/lua-nginx-module#ngxrematch]]: the "ctx" parameter table's "pos" field should start from 1 instead of 0.
** bugfix: fixed compilation errors with Nginx older than 1.0.0.
** bugfix: localizing the [[coroutine.*|https://github.com/chaoslawful/lua-nginx-module#coroutinecreate]] API functions in [[init_by_lua*|https://github.com/chaoslawful/lua-nginx-module#init_by_lua]] for future use in contexts like [[content_by_lua*|https://github.com/chaoslawful/lua-nginx-module#content_by_lua]] might hang the request. thanks James Hurst for the report.
* upgraded SrcacheNginxModule to 0.24.
** bugfix: fixed compilation errors with Nginx older than 0.9.2.
* bugfix: applied the [[cache_manager_exit patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.3-cache_manager_exit.patch]] to the Nginx core to fix an issue when the cache manager process is shutting down.
! Mainline Version 1.4.3.1 - 29 October 2013
* upgraded the Nginx core to 1.4.3.
** see the changes here: http://nginx.org/en/CHANGES-1.4
* upgraded LuaNginxModule to 0.9.1.
** feature: added the new configuration directive [[lua_use_default_type|https://github.com/chaoslawful/lua-nginx-module#lua_use_default_type]] for controlling whether to send out a default {{{Content-Type}}} response header (as defined by the [[default_type|http://nginx.org/en/docs/http/ngx_http_core_module.html#default_type]] directive). default on. thanks aviramc for the patch.
** feature: now the raw request cosocket returned by [[ngx.req.socket(true)|https://github.com/chaoslawful/lua-nginx-module#ngxreqsocket]] no longer requires the request body to be read already, which means that one can use this cosocket to read the raw request body data as well. thanks aviramc for the original patch.
** bugfix: when there were no existing {{{Cache-Control}}} response headers, {{{ngx.header.cache_control = nil}}} would (incorrectly) create a new {{{Cache-Control}}} header with an empty value. thanks jinglong for the patch.
** bugfix: the original letter-case of the header name was lost when creating the {{{Cache-Control}}} response header via the [[ngx.header.HEADER|https://github.com/chaoslawful/lua-nginx-module#ngxheaderheader]] API.
** bugfix: [[ngx.req.set_header("Host", value)|https://github.com/chaoslawful/lua-nginx-module#ngxreqset_header]] would overwrite the value of [[$host|http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host]] with bad values. thanks aviramc for the patch.
** bugfix: use of [[ngx.exit()|https://github.com/chaoslawful/lua-nginx-module#ngxexit]] to abort pending subrequests in other "light threads" might lead to segfault or request hang when HTTP 1.0 full buffering is in effect.
** bugfix: removing a request header might lead to memory corruptions. thanks Bjørnar Ness for the report.
** bugfix: reading [[ngx.status|https://github.com/chaoslawful/lua-nginx-module#ngxstatus]] might get different values than [[$status|http://nginx.org/en/docs/http/ngx_http_core_module.html#var_status]]. thanks Kevin Burke for the report.
** bugfix: downstream write events might interfere with upstream cosockets that are slow to write to. thanks Aviram Cohen for the report.
** bugfix: the bookkeeping state for already-freed user threads might be incorrectly used by newly-created threads that were completely different, which could lead to bad results. thanks Sam Lawrence for the report.
** bugfix: calling [[ngx.thread.wait()|https://github.com/chaoslawful/lua-nginx-module#ngxthreadwait]] on a user thread object that is already waited (i.e., already dead) would hang forever. thanks Sam Lawrence for the report.
** bugfix: the alert "zero size buf" could be logged when assigning an empty Lua string ("") to {{{ngx.arg[1]}}} in [[body_filter_by_lua|https://github.com/chaoslawful/lua-nginx-module#body_filter_by_lua]]*.
** bugfix: subrequests initiated by [[ngx.location.capture|https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture]]* could trigger unnecessary response header sending actions in the subrequest because our capturing output header filter did not set {{{r->header_sent}}}.
** bugfix: the Lua error message for the case that [[ngx.sleep()|https://github.com/chaoslawful/lua-nginx-module#ngxsleep]] was used in [[log_by_lua|https://github.com/chaoslawful/lua-nginx-module#log_by_lua]]* was not friendly. thanks Jiale Zhi for the report.
** bugfix: now [[ngx.req.socket(true)|https://github.com/chaoslawful/lua-nginx-module#ngxreqsocket]] returns proper error when there is some other "light thread" reading the request body.
** bugfix: [[header_filter_by_lua|https://github.com/chaoslawful/lua-nginx-module#header_filter_by_lua]]*, [[body_filter_by_lua|https://github.com/chaoslawful/lua-nginx-module#body_filter_by_lua]]*, and [[ngx.location.capture|https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture]]* might not work properly with multiple "http {}" blocks in {{{nginx.conf}}}. thanks flygoast for the report.
** optimize: made [[ngx.re.match|https://github.com/chaoslawful/lua-nginx-module#ngxrematch]] and [[ngx.re.gmatch|https://github.com/chaoslawful/lua-nginx-module#ngxregmatch]] faster for LuaJIT 2.x when there is no submatch captures.
** optimize: pre-allocate space for the Lua tables in various places.
** doc: fixed the context for the [[lua_package_path|https://github.com/chaoslawful/lua-nginx-module#lua_package_path]] and [[lua_package_cpath|https://github.com/chaoslawful/lua-nginx-module#lua_package_cpath]] directives. thanks duhoobo for the report.
* upgraded HeadersMoreNginxModule to 0.23.
** bugfix: removing request headers via [[more_clear_input_headers|https://github.com/agentzh/headers-more-nginx-module#more_clear_input_headers]] might lead to memory corruptions.
** bugfix: [[more_set_input_headers|https://github.com/agentzh/headers-more-nginx-module#more_set_input_headers]] might overwrite the value of the [[$host|http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host]] variable with bad values.
** bugfix: [[more_set_headers|https://github.com/agentzh/headers-more-nginx-module#more_set_headers]] and [[more_clear_headers|https://github.com/agentzh/headers-more-nginx-module#more_clear_headers]] might not work when multiple "http {}" blocks were used in {{{nginx.conf}}}.
** bugfix: eliminated use of C global variables during configuration phase because it might lead to issues when HUP reload failed.
* upgraded SrcacheNginxModule to 0.23.
** bugfix: this module might not work properly with multiple "http {}" blocks in {{{nginx.conf}}}.
** bugfix: we might (incorrectly) return 500 in our output filters.
** bugfix: we did not set {{{r->header_sent}}} when we want to discard the header in our header filter.
* upgraded RdsJsonNginxModule to 0.12.
** bugfix: in case of multiple "http {}" blocks in {{{nginx.conf}}}, our output filters might be disabled even when this module is configured properly.
** bugix: we did not check the {{{NULL}}} pointer returned by an Nginx array element allocation.
* upgraded RdsCsvNginxModule to 0.05.
** optimize: we now only register our output filters when this module is indeed used (the only exception is when multiple "http {}" blocks are used).
* upgraded XssNginxModule to 0.04.
** optimize: we now only register our output filters when this module is indeed used (the only exception is when multiple "http {}" blocks are used).
* upgraded EchoNginxModule to 0.49.
** bugfix: [[echo_before_body|https://github.com/agentzh/echo-nginx-module#echo_before_body]] and [[echo_after_body|https://github.com/agentzh/echo-nginx-module#echo_after_body]] might now work properly when multiple "http {}" blocks were used in {{{nginx.conf}}}.
* upgraded LuaRestyRedisLibrary to 0.17.
** optimize: added an optional argument "n" to [[init_pipeline()|https://github.com/agentzh/lua-resty-redis#init_pipeline]] as a hint for the number of pipelined commands.
** optimize: use LuaJIT 2.1's new [[table.new() primitive|http://repo.or.cz/w/luajit-2.0.git/commit/c8cfca055]] to pre-allocate space for Lua tables.
* upgraded LuaRestyUploadLibrary to 0.09.
** bugfix: removed use of the [[module()|http://www.lua.org/manual/5.1/manual.html#pdf-module]] function to prevent bad side-effects.
** optimize: Removed use of lua tables and [[table.concat()|http://www.lua.org/manual/5.1/manual.html#pdf-table.concat]] for simple one-line Lua string concatenations.
* upgraded LuaRestyMySQLLibrary to 0.14.
** bugfix: avoided using Lua 5.1's [[module()|http://www.lua.org/manual/5.1/manual.html#pdf-module]] function for defining our Lua modules because it has bad side effects.
** optimize: added an optional new argument "nrows" to the [[query()|https://github.com/agentzh/lua-resty-mysql#query]] and [[read_result()|https://github.com/agentzh/lua-resty-mysql#read_result]] methods, which can speed up things a bit.
** optimize: use LuaJIT v2.1's new [[table.new()|http://repo.or.cz/w/luajit-2.0.git/commit/c8cfca055]] API to optimize Lua table allocations. when table.new is missing, just fall back to the good old "{}" constructor. this gives 12% overall speed-up for a typical result set with 500 rows when LuaJIT 2.1 is used.
** optimize: eliminated use of [[table.insert()|http://www.lua.org/manual/5.1/manual.html#pdf-table.insert]] because it is slower than "tb[#tb + 1] = val".
** optimize: switched over to the multi-argument form of [[string.char()|http://www.lua.org/manual/5.1/manual.html#pdf-string.char]].
** optimize: no longer use Lua tables and [[table.concat()|http://www.lua.org/manual/5.1/manual.html#pdf-table.concat]] to construct simple query strings.
* upgraded LuaRestyWebSocketLibrary to 0.02.
** optimize: use LuaJIT 2.1's [[table.new()|http://repo.or.cz/w/luajit-2.0.git/commit/c8cfca055]] to preallocate space for Lua tables, eliminating the overhead of Lua table rehash.
* feature: applied the [[proxy_host_port_vars patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.3-proxy_host_port_vars.patch]] to the Nginx core to make {{{$proxy_host}}} and {{{$proxy_port}}} accessible for dynamic languages like Lua and Perl.
* bugfix: applied the [[gzip_flush_bug patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.3-gzip_flush_bug.patch]] to the Nginx core to fix request hang caused by the [[ngx_gzip|http://nginx.org/en/docs/http/ngx_http_gzip_module.html]] and [[ngx_gunzip|http://nginx.org/en/docs/http/ngx_http_gzip_module.html]] modules when using [[ngx.flush(true)|https://github.com/chaoslawful/lua-nginx-module#ngxflush]], for example. Thanks Maxim Dounin for the review.
* bugfix: applied the [[cache_lock_hang_in_subreq patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.3-cache_lock_hang_in_subreq.patch]] to the Nginx core to fix the request hang when using [[proxy_cache_lock|http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_lock]] in subrequests and the cache lock timeout happens.
* bugfix: backported Maxim Dounin's [[patch|https://github.com/agentzh/ngx_openresty/blob/master/patches/nginx-1.4.3-gzip_buffered_bug.patch]] to fix an issue in the [[ngx_gzip module|http://nginx.org/en/docs/http/ngx_http_gzip_module.html]]: it did not clear {{{r->connection->buffered}}} when the pending data was already flushed out. this could hang LuaNginxModule's [[ngx.flush(true)|https://github.com/chaoslawful/lua-nginx-module#ngxflush]] call, for example.
See ChangeLog1004002 for change log for OpenResty 1.4.2.x.
<<toolbar permalink>>
! Mainline Version 1.5.8.1 - 10 January 2014
* change: now we default to LuaJIT instead of the standard Lua 5.1 interpreter. the {{{--with-luajit}}} option for {{{./configure}}} is now the default. To use the standard Lua 5.1 interpreter, specify the {{{--with-lua51}}} option explicitly. thanks smallfish for the suggestion.
* bugfix: Nginx's built-in resolver did not accept fully qualified domain names (with a trailing dot).
* optimize: shortened the {{{Server}}} response header string "ngx_openresty" to "openresty".
* upgraded the Nginx core to 1.5.8.
** see the changes here: http://nginx.org/en/CHANGES
* upgraded LuaJIT to v2.1-20140109.
** bugfix: fixed ABC (Array Bounds Check) elimination. (Mike Pall)
** bugfix: fixed ~MinGW build. (Mike Pall)
** bugfix: x86: fixed stack slot counting for ~IR_CALLA (affects table.new). (Mike Pall) this could lead to random table field missing issues in LuaRestyMySQLLibrary on i386. thanks lhmwzy for the report.
** bugfix: fixed compilation of {{{string.byte(s, nil, n)}}}. (Mike Pall)
** bugfix: MIPS: Cosmetic fix for interpreter. (Mike Pall)
* upgraded LuaNginxModule to 0.9.4.
** feature: allow use of [[ngx.exit()|https://github.com/chaoslawful/lua-nginx-module#ngxexit]] in the context of [[header_filter_by_lua*|https://github.com/chaoslawful/lua-nginx-module#header_filter_by_lua]] to perform a "filter finalization". but in this context [[ngx.exit()|https://github.com/chaoslawful/lua-nginx-module#ngxexit]] is an asynchronous operation and returns immediately.
** feature: added the optional 5th argument, "res_table", to [[ngx.re.match()|https://github.com/chaoslawful/lua-nginx-module#ngxrematch]] which is the user-supplied result table for the resulting captures. This feature can give 12%+ speedup for simple [[ngx.re.match()|https://github.com/chaoslawful/lua-nginx-module#ngxrematch]] calls with 4 submatch captures.
** feature: [[ngx.escape_uri()|https://github.com/chaoslawful/lua-nginx-module#ngxescape_uri]] and [[ngx.unescape_uri()|https://github.com/chaoslawful/lua-nginx-module#ngxunescape_uri]] now accept a {{{nil}}} argument, which is equivalent to an empty string.
** feature: added new pure C API, {{{ngx_http_lua_ffi_max_regex_cache_size}}}, for ~FFI-based implementations like LuaRestyCoreLibrary.
** change: [[ngx.decode_base64()|https://github.com/chaoslawful/lua-nginx-module#ngxdecode_base64]] now only accepts string arguments.
** bugfix: coroutines might incorrectly enter the "dead" state even right after creation with [[coroutine.create()|https://github.com/chaoslawful/lua-nginx-module#coroutinecreate]]. thanks James Hurst for the report.
** bugfix: segmentation fault might happen when aborting a "light thread" pending on downstream cosocket writes. thanks Aviram Cohen for the report.
** bugfix: we might try sending the response header again in [[ngx.exit()|https://github.com/chaoslawful/lua-nginx-module#ngxexit]] when the header was already sent.
** bugfix: subrequests initiated by [[ngx.location.capture()|https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture]] might send their own response headers more than once. this issue might also lead to the alert message "header already sent" and request aborts when nginx 1.5.4+ was used.
** bugfix: fixed incompatibilities in Nginx 1.5.8 which breaks the resolver API in the Nginx core.
** bugfix: fixed a compilation warning when PCRE is disabled in the build. thanks Jay for the patch.
** bugfix: we did not set the shortcut fields in {{{r->headers_in}}} for request headers in our subrequests created by [[ngx.location.capture*()|https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture]], which might cause inter-operative issues with other Nginx modules. thanks Aviram Cohen for the original patch.
** optimize: we no longer clear the {{{lua_State}}} pointers for dead "light threads" such that their coroutine context structs could be reused by other "light threads" and user coroutines. this can lead to smaller memory footprint.
** doc: documented that the [[coroutine.*|https://github.com/chaoslawful/lua-nginx-module#coroutinecreate]] API can be used in [[init_by_lua|https://github.com/chaoslawful/lua-nginx-module#init_by_lua]]* since 0.9.2. thanks Ruoshan Huang for the reminder.
* upgraded LuaRestyMemcachedLibrary to 0.13.
** optimize: saved one cosocket [[receive()|https://github.com/chaoslawful/lua-nginx-module#tcpsockreceive]] call in the [[get()|https://github.com/agentzh/lua-resty-memcached#get]] and [[gets()|https://github.com/agentzh/lua-resty-memcached#gets]] methods.
** bugfix: the Memcached connection might enter a bad state when read timeout happens because LuaNginxModule's cosocket reading calls no longer automatically close the connection in this case. thanks Dane Knecht for the report.
* upgraded LuaRestyRedisLibrary to 0.18.
** optimize: eliminated one (potentially expensive) {{{string.sub()}}} call in the Redis reply parser.
** bugfix: the Redis connection might enter a bad state when read timeout happens because LuaNginxModule's cosocket reading calls no longer automatically close the connection in this case.
* upgraded LuaRestyLockLibrary to 0.02.
** bugfix: the [[lock()|https://github.com/agentzh/lua-resty-lock#lock]] method accepted nil keys silently.
* upgraded LuaRestyDNSLibrary to 0.11.
** bugfix: avoided use of the module() built-in to define the Lua module.
** bugfix: we did not reject bad domain names with a leading dot. thanks Dane Knecht for the report.
** bugfix: error handling fixes in the [[query|https://github.com/agentzh/lua-resty-dns#query]] and [[tcp_query|https://github.com/agentzh/lua-resty-dns#tcp_query]] methods.
* upgraded LuaRestyCoreLibrary to 0.0.3.
** feature: updated to comply with LuaNginxModule 0.9.4.
** bugfix: [[resty.core.regex|https://github.com/agentzh/lua-resty-core#restycoreregex]]: the [[ngx.re|https://github.com/chaoslawful/lua-nginx-module#ngxrematch]] API did not honour the [[lua_regex_cache_max_entries|https://github.com/chaoslawful/lua-nginx-module#lua_regex_cache_max_entries]] configuration directive.
** optimize: [[ngx.re.gsub|https://github.com/chaoslawful/lua-nginx-module#ngxregsub]] used to use literal type string "const char *" in ffi.cast() which is expensive in interpreter mode. now we use the ctype object directly, which leads to 11% speedup in interpreter mode.
* upgraded EchoNginxModule to 0.51.
** bugfix: for Nginx 1.2.6+ and 1.3.9+, the main request reference count might go out of sync when Nginx's request body reader returned status code 300+. thanks Hungpu DU for the report.
** bugfix: [[echo_request_body|https://github.com/agentzh/echo-nginx-module#echo_request_body]] truncated the response body prematurely when the request body was in memory (because the request reader sets "last_buf" in this case). thanks Hungpu DU for the original patch.
** bugfix: using [[$echo_timer_elapsed|https://github.com/agentzh/echo-nginx-module#echo_timer_elapsed]] variable alone in the configuration caused segmentation faults. thanks Hungpu DU for the report.
** doc: typo fix in the [[echo_foreach_split|https://github.com/agentzh/echo-nginx-module#echo_foreach_split]] sample code. thanks Hungpu DU for the report.
* upgraded DrizzleNginxModule to 0.1.7.
** bugfix: fixed most of warnings and errors from the Microsoft Visual C++ compiler, reported by Edwin Cleton.
* upgraded HeadersMoreNginxModule to 0.25.
** bugfix: fixed a warning from the Microsoft C compiler. thanks Edwin Cleton for the report.
** doc: documented the limitation that we cannot remove the "Connection" response header with this module. thanks Michael Orlando for bringing this up.
* upgraded SetMiscNginxModule to 0.24.
** bugfix: fixed the warnings from the Microsoft C compiler. thanks Edwin Cleton for the report.
* upgraded SrcacheNginxModule to 0.25.
** feature: now the value specified in [[srcache_store_skip|https://github.com/agentzh/srcache-nginx-module#srcache_store_skip]] is evaluated and tested again right after the end of the response body data stream is seen. thanks Eldar Zaitov for the patch.
See ChangeLog1004003 for change log for OpenResty 1.4.3.x.
<<toolbar permalink>>
! Version 1.5.11.1 - 30 March 2014
* upgraded LuaJIT to v2.1-20140330.
** feature: included Mike Pall's new "trace stitching" feature that can compile around most of the [[NYI items|http://wiki.luajit.org/NYI]]. thanks [[CloudFlare Inc.|http://www.cloudflare.com/]] for sponsoring the development. This helps compiling more Lua code. For example, it gives 10% ~ 40% speedup in simple test cases of LuaRestyMySQLLibrary out of the box.
** bugfix: included all the new bug fixes from Mike Pall, most of which are very obscure bugs in the JIT compiler hidden for years.
** relaxed the hard-coded heuristic limit further to 100 for loopunroll.
** feature: applied John Marino's patch for compiling LuaJIT on ~DragonFlyBSD. thanks lhmwzy for proposing the patch.
* upgraded the Nginx core to 1.5.11.
** see the changes here: http://nginx.org/en/CHANGES
* bugfix: applied the patch to the NGINX core for the latest SPDY security vulnerability (~CVE-2014-0133).
* feature: added support for ~DragonFlyBSD to {{{./configure}}}. thanks lhmwzy for the patch.
* bugfix: disabled the -Werror option for clang because it caused build failures at least in recent Mac OS X systems. thanks Hamish Forbes for the report.
* feature: bundled new component LuaRestyUpstreamHealthcheckLibrary 0.01.
** see the documentation for details: https://github.com/agentzh/lua-resty-upstream-healthcheck#readme
* feature: bundled new component LuaUpstreamNginxModule 0.01.
** see the documentation for details: https://github.com/agentzh/lua-upstream-nginx-module#readme
* upgraded LuaNginxModule to 0.9.6.
** feature: added new configuration directives, [[init_worker_by_lua|https://github.com/chaoslawful/lua-nginx-module/#init_worker_by_lua]] and [[init_worker_by_lua_file|https://github.com/chaoslawful/lua-nginx-module/#init_worker_by_lua_file]], to run Lua code upon every nginx worker process's startup.
** feature: added new API function [[ngx.config.nginx_configure()|https://github.com/chaoslawful/lua-nginx-module/#ngxconfignginx_configure]] to return the NGINX {{{./configure}}} arguments string to the Lua land. thanks Tatsuhiko Kubo for the patch.
** feature: added new API function [[ngx.resp.get_headers()|https://github.com/chaoslawful/lua-nginx-module/#ngxrespget_headers]] for fetching all the response headers. thanks Tatsuhiko Kubo for the patch.
** feature: added new API function [[ngx.worker.pid()|https://github.com/chaoslawful/lua-nginx-module/#ngxworkerpid]] for retrieving the current nginx worker process's pid.
** feature: explicitly check Lua langauge version mismatch; we only accept the Lua 5.1 language (for now).
** bugfix: accessing a cosocket object from a request which does not create it could lead to segmentation faults. now we throw out a Lua error "bad request" properly in this case.
** change: it is now the user's responsibility to clear the captures table for [[ngx.re.match()|https://github.com/chaoslawful/lua-nginx-module/#ngxrematch]].
** bugfix: we should prefix our chunk names for from-string lua source (which also leads to nicer error messages). thanks Mike Pall for the catch.
** bugfix: subrequests initiated by [[ngx.location.capture*|https://github.com/chaoslawful/lua-nginx-module/#ngxlocationcapture]] with the HEAD method did not result in responses without response bodies. thanks Daniel for the report.
**  bugfix: segfault might happen in the FFI API for destroying compiled PCRE regexes, which affects libraries like LuaRestyCoreLibrary. thanks Dane Kneche.
** bugfix: fixes for small string buffer arguments in the C API for ~FFI-based implementations of [[shdict:get()|https://github.com/chaoslawful/lua-nginx-module/#ngxshareddictget]].
** bugfix: fixed the error message buffer overwrite in the C API for ~FFI-based [[ngx.re|https://github.com/chaoslawful/lua-nginx-module/#ngxrematch]] implementations.
** bugfix: use of the public C API in other nginx C modules (extending LuaNginxModule) lead to compilation errors and warnings when the Microsoft C compiler is used. thanks Edwin Cleton for the report.
** bugfix: segmentation faults might happen when multiple "light threads" in the same request manipuate a stream cosocket object in turn. thanks Aviram Cohen for the report.
** bugfix: timers created by ngx.timer.at() might not be aborted prematurely upon nginx worker exit. thanks Hamish Forbes for the report.
** bugfix: the return value sizes of the C functions {{{ngx_http_lua_init_by_inline}}} and {{{ngx_http_lua_init_by_file}}} were wrong.
** optimize: coroutine status string look-up is now a bit more efficient by specifying the string lengths explicitly. thanks Tatsuhiko Kubo for the patch.
** various code refactoring.
* upgraded LuaRestyCoreLibrary to 0.0.5.
** change: now it is the user's responsibility to clear the input result table.
** feature: [[resty.core.regex|https://github.com/agentzh/lua-resty-core#restycoreregex]]: added new function {{{set_buf_grow_ratio}}} to control the buffer grow ratio (default 2.0).
** bugfix: segmentation fault might happen due to assignments to [[ngx.header.HEADER|https://github.com/chaoslawful/lua-nginx-module/#ngxheaderheader]] because we did not anchor the memory buffer properly which might get collected prematurely.
** bugfix: [[ngx.req.get_headers|https://github.com/chaoslawful/lua-nginx-module/#ngxreqget_headers]]: we need to anchor the string buffer being casted otherwise it might be accidentally garbage collected when we still hold a C pointer to it. this bug might lead to segmentation faults.
** optimize: cache the match captures table for [[ngx.re.gsub()|https://github.com/chaoslawful/lua-nginx-module/#ngxregsub]] when a function-typed "replace" argument is specified. this gives a remarkable speedup.
** optimize: [[resty.core.regex|https://github.com/agentzh/lua-resty-core#restycoreregex]]: forked the original shared code paths to multiple specialized versions, which helps the JIT compiler.
** optimize: [[resty.core.regex|https://github.com/agentzh/lua-resty-core#restycoreregex]]: cache the parsing results for the regex option strings. thanks Mike Pall for the suggestion.
* upgraded LuaRestyRedisLibrary to 0.20.
** feature: added new redis 2.8.0 commands: {{{scan}}}, {{{sscan}}}, {{{hscan}}}, and {{{zscan}}}. thanks Dragonoid for the patch.
** feature: [[the read_reply()|https://github.com/agentzh/lua-resty-redis#read_reply]] method can now be re-tried immediately after a "timeout" error is returned.
** bugfix: the {{{unsubscribe}}}/{{{subscribe}}} commands could not be called after [[read_reply()|https://github.com/agentzh/lua-resty-redis#read_reply]] returned "timeout". thanks doujiang for the patch.
** bugfix: we incorrectly allowed reusing redis connections in the "subscribed" state. thanks doujiang for the patch.
* upgraded LuaCjsonLibrary to 2.1.0.1.
** rebased on lua-cjson 2.1.0: http://www.kyne.com.au/~mark/software/NEWS-lua-cjson.txt the most notable new feature is the {{{cjson.safe}}} module.
** feature: applied Jiale Zhi's patch to add the new config function {{{encode_empty_table_as_object}}} so that we can encode empty Lua tables into empty JSON arrays.
* upgraded SrcacheNginxModule to 0.26.
** bugfix: HEAD requests might result in response bodies.
* upgraded EchoNginxModule to 0.52.
** bugfix: HEAD subrequests could still result in non-empty response bodies.
See ChangeLog1005008 for change log for OpenResty 1.5.8.x.
<<toolbar permalink>>
! Version 1.5.12.1 - 29 April 2014
* upgraded the Nginx core to 1.5.12.
** see the changes here: http://nginx.org/en/CHANGES
* upgraded LuaJIT to v2.1-20140423 (see https://github.com/openresty/luajit2/releases ).
** bugfix: prevent adding side traces for stack checks. (Mike pall) this could cause internal assertion failure in the JIT compiler while replaying snapshots in very obscure cases: {{{lj_snap.c:497: lj_snap_replay: Assertion `ir->o == IR_CONV && ir->op2 == ((IRT_NUM<<5)|IRT_INT)' failed.}}}
** bugfix: fixed FOLD of string concatenations. (Mike Pall) this issue was reported by leafo and could lead to invalid string results in special cases while compiling string concatenations.
** bugfix: FFI: fixed cdata equality comparison against strings and other Lua types. (Mike Pall)
** bugfix: fixed top slot calculation for snapshots with continuations. (Mike Pall) this was a bug in snapshot generation, but it only surfaced with trace stitching. it could cause Lua stack overwrites in special cases.
** bugfix: PPC: don't use mcrxr on PPE. (Mike Pall)
** bugfix: prevent GC estimate miscalculation due to buffer growth. (Mike Pall)
** bugfix: fixed the regression introduced by the previous fix for "reuse of SCEV results in FORL". (Mike Pall) this could cause internal assertion failure in the JIT compiler: {{{lj_record.c:68: rec_check_ir: Assertion `op2 >= nk' failed.}}}
** bugfix: fixed alias analysis for {{{table.len}}} vs. {{{table.clear}}}. (Mike Pall) this could cause {{{table.len}}} to return incorrect values (nonzero values) after {{{table.clear}}} was performed.
** bugfix: fixed the compatibility with ~DragonFlyBSD. thanks lhmwzy for the patch.
** feature: allow non-scalar cdata to be compared for equality by address. (Mike Pall)
* upgraded LuaUpstreamNginxModule to 0.02.
** bugfix: upstream names did not support taking a port number. thanks magicleo for the report.
* upgraded Redis2NginxModule to 0.11.
** change: now we always ignore client aborts for collaborations with other modules like SrcacheNginxModule. thanks akamatgi for the report.
* upgraded LuaNginxModule to 0.9.7.
**  bugfix: when [[lua_code_cache|https://github.com/openresty/lua-nginx-module#lua_code_cache]] was off, [[cosocket:setkeepalive()|https://github.com/openresty/lua-nginx-module#tcpsocksetkeepalive]] might lead to segmentation faults. thanks Kelvin Peng for the report.
** refactor: improved the error handling and logging in the Lua code loader and closure factory.
** change: added stronger assertions to the stream-typed cosocket implementation.
** optimize: we no longer call {{{ngx_pfree()}}} in our own {{{pcre_free}}} hook.
** optimize: we no longer clear the pointer {{{ctx->user_co_ctx}}} in {{{ngx_http_lua_reset_ctx}}}.
* upgraded EchoNginxModule to 0.53.
** bugfix: use of empty arguments after the {{{-n}}} option of the [[echo|https://github.com/openresty/echo-nginx-module#echo]] directive (and its friends) might cause subsequent arguments to get discarded. thanks Lice Pan for the report and fix.
* upgraded FormInputNginxModule to 0.08.
** bugfix: segmentation fault might happen when {{{set_form_input_multi}}} was used while no proper {{{Content-Type}}} request header was given.
* upgraded LuaRestyWebSocketLibrary to 0.03.
** optimize: added a minor optimization in the [[recv_frame()|https://github.com/openresty/lua-resty-websocket#recv_frame]] method. thanks yurnerola for the catch.
* upgraded LuaRestyCoreLibrary to 0.0.6.
** optimize: [[ngx.re.sub|https://github.com/openresty/lua-nginx-module#ngxresub]]/[[ngx.re.gsub|https://github.com/openresty/lua-nginx-module#ngxregsub]]: now we avoid constructing new Lua strings for the regex cache keys, which gives 5% speedup for trivial use cases.
** optimize: [[ngx.re.match|https://github.com/openresty/lua-nginx-module#ngxrematch]]/[[ngx.re.find|https://github.com/openresty/lua-nginx-module#ngxrefind]]: avoided constructing a new Lua string for the regex cache key by switching over to a cascaded 2-level hash table, which gives 22% speedup for simple use cases.
* upgraded LuaRestyLockLibrary to 0.03.
** bugfix: prevented using cdata directly as table keys.
* upgraded LuaRestyStringLibrary to 0.09.
** bugfix: avoided using the "module" builtin function to define lua modules. thanks lhmwzy for the original patch.
See ChangeLog1005011 for change log for OpenResty 1.5.11.x.
<<toolbar permalink>>
! Version 1.7.0.1 - 7 June 2014
* upgraded the Nginx core to 1.7.0.
** see the changes here: http://nginx.org/en/CHANGES
* feature: bundled new Lua library, LuaRestyLrucacheLibrary, which is also enabled by default. see https://github.com/openresty/lua-resty-lrucache#readme for more details. thanks Shuxin Yang for the help.
* upgraded LuaJIT to v2.1-20140607: https://github.com/openresty/luajit2/tags
** imported Mike Pall's latest bug fixes and other changes:
*** Fix frame traversal while searching for error function.
*** Fix FOLD rule for STRREF of SNEW.
*** FFI: Fix recording of indexing a struct pointer ctype object itself.
*** FFI: Another fix for cdata equality comparisons.
*** Fix FOLD rule for {{{string.sub(s, ...) == k}}}.
*** x86: Fix code generation for unused result of {{{math.random()}}}.
*** x64: Workaround for MSVC build issue.
*** PPC: Fix red zone overflow in machine code generation.
*** Fix compatibility issues with Illumos. Thanks to Theo Schlossnagle.
*** Add PS Vita port. Thanks to Anton Stenmark.
** disabled trace stitching by default for now since it may trigger random lua stack corruptions when using with ngx_lua.
** feature: jit.dump: output Lua source location after every BC.
** feature: added internal memory-buffer-based trace entry/exit/start-recording event logging, mainly for debugging bugs in the JIT compiler. it requires {{{-DLUA_USE_TRACE_LOGS}}} when building.
** feature: save {{{g->jit_base}}} to {{{g->saved_jit_base}}} before {{{lj_err_throw}}} clears {{{g->jit_base}}} which makes it impossible to get Lua backtrace in such states.
* upgraded LuaRestyCoreLibrary to 0.0.7.
** feature: implemented [[ngx.req.set_header()|https://github.com/openresty/lua-nginx-module/#ngxreqset_header]] (partial: table-typed values not yet supported) and [[ngx.req.clear_header()|https://github.com/openresty/lua-nginx-module/#ngxreqclear_header]] with FFI in the [[resty.core.request|https://github.com/openresty/lua-resty-core#restycorerequest]] module.
** feature: implemented [[shdict:flush_all()|https://github.com/openresty/lua-nginx-module/#ngxshareddictflush_all]] with FFI in the [[resty.core.shdict|https://github.com/openresty/lua-resty-core#restycoreshdict]].
** feature: implemented [[ngx.req.set_method()|https://github.com/openresty/lua-nginx-module/#ngxreqset_method]] with FFI in [[resty.core.request|https://github.com/openresty/lua-resty-core#restycorerequest]].
** feature: implemented [[ngx.req.get_method()|https://github.com/openresty/lua-nginx-module/#ngxreqget_method]] with FFI in [[resty.core.request|https://github.com/openresty/lua-resty-core#restycorerequest]].
** feature: implemented [[ngx.time()|https://github.com/openresty/lua-nginx-module/#ngxtime]] with FFI in [[resty.core.time|https://github.com/openresty/lua-resty-core#restycoretime]].
** feature: implemented [[ngx.req.start_time|https://github.com/openresty/lua-nginx-module/#ngxreqstart_time]] with FFI in [[rest.core.request|https://github.com/openresty/lua-resty-core#restycorerequest]].
** feature: implemented [[ngx.now()|https://github.com/openresty/lua-nginx-module/#ngxnow]] with FFI in [[resty.core.time|https://github.com/openresty/lua-resty-core#restycoretime]].
* upgraded LuaNginxModule to 0.9.8.
** bugfix: the [[ngx.ctx|https://github.com/openresty/lua-nginx-module/#ngxctx]] table might be released prematurely when [[ngx.exit()|https://github.com/openresty/lua-nginx-module/#ngxexit]] was used to generate the response header. thanks Monkey Zhang for the report. now we always release [[ngx.ctx|https://github.com/openresty/lua-nginx-module/#ngxctx]] in our request pool cleanup handler.
** bugfix: we did not call our coroutine cleanup handlers right after our coroutine completes (either successfully or unsuccessfully) otherwise segmentation fault might happen when the Lua VM throws out unexpected exceptions like "attempt to yield across C-call boundary". thanks Lipin Dmitriy for the report.
** bugfix: nginx does not guarentee the parent pointer of the rbtree root is meaningful, which could lead to inifinite loops when LuaNginxModule tried to abort pending timers prematurely (upon worker exit). thanks pengqi for the report.
** bugfix: [[ngx.req.set_method()|https://github.com/openresty/lua-nginx-module/#ngxreqset_method]]: we incorrectly modified {{{r->method}}} when the method ID was wrong.
** bugfix: [[rewrite_by_lua*|https://github.com/openresty/lua-nginx-module/#rewrite_by_lua]] and [[access_by_lua*|https://github.com/openresty/lua-nginx-module/#access_by_lua]] will now terminate the current request if the response header has already been sent (via calls like [[ngx.say|https://github.com/openresty/lua-nginx-module/#ngxsay]] and [[ngx.send_headers|https://github.com/openresty/lua-nginx-module/#ngxsend_headers]]) at that point. thanks yaronli and Sophos for the report.
** bugfix: issues in the error handling for pure C API functions for shared dict. thanks Xiaochen Wang.
** feature: now we save the original pattern string pointer value into our {{{ngx_http_lua_regex_t}}} C struct, to help runtime regex profiling and debugging.
** feature: allow use of 3rd-party pcre bindings in [[init_by_lua*|https://github.com/openresty/lua-nginx-module/#init_by_lua]]. thanks ikokostya for the feature request.
** feature: added pure C API functions to support the new ~FFI-based Lua API implemented in LuaRestyCoreLibrary.
** feature: make use of the new shm API in nginx 1.5.13+ to suppress the "no memory" error logging when the shared dictionaries run out of memory.
** feature: added C macro {{{NGX_LUA_ABORT_AT_PANIC}}} to allow generating a core dump when the Lua VM panics.
* upgraded SrcacheNginxModule to 0.27.
** bugfix: we used to skip all the output header and body filters run before our filters (which unfortunately bypassed the standard ngx_http_not_modified_filter_module, for example). thanks Lloyd Zhou for the report.
** feature: added new config directive [[srcache_store_ranges|https://github.com/openresty/srcache-nginx-module#srcache_store_ranges]] for storing 206 Partial Content responses generated by the standard ngx_http_range_filter_module.
* bugfix: updated the dtrace patch because systemtap 2.5 no longer accepts the {{{-xnolib}}} option in its dtrace utility.
* removed our bundled version of {{{ngx_http_auth_request_module}}} because recent versions of the nginx core already have it. thanks ~LazyZhu for the report.
* bugfix: applied our patch for the nginx core to fix the long standing memory fragmentation issue for blocks larger than the page size in the nginx slab allocator: http://mailman.nginx.org/pipermail/nginx-devel/2014-May/005316.html thanks Shuxin Yang for the help.
See ChangeLog1005012 for change log for OpenResty 1.5.12.x.
<<toolbar permalink>>
! Version 1.7.2.1 - 12 July 2014
* upgraded the Nginx core to 1.7.2.
** see the changes here: http://nginx.org/en/CHANGES
* upgraded LuaJIT to v2.1-20140707: https://github.com/openresty/luajit2/tags
** imported Mike Pall's latest bug fixes and other changes:
*** feature: compile debug.getmetatable(). Thanks to Karel Tuma.
*** bugfix: Fix ABC elimination (for negative table indexes, for example).
*** bugfix: FFI: Fix compilation of reference field access.
*** bugfix: FFI: fixed frame traversal for backtraces with FFI callbacks.
*** bugfix: x86: lj_math_random_step() clobbers XMM regs on OSX Clang.
*** bugfix: fixed debug info for main chunk of stripped bytecode.
* upgraded LuaRestyCoreLibrary to 0.0.8.
** feature: [[resty.core.regex|https://github.com/openresty/lua-resty-core#restycoreregex]]: use {{{resty.lrucache}}} for the compiled regex cache for [[ngx.re.find|https://github.com/openresty/lua-nginx-module#ngxrefind]] and [[ngx.re.match|https://github.com/openresty/lua-nginx-module#ngxrematch]] in order to prevent pathalogical performance when the number of regexes has exceeded [[lua_regex_cache_max_entries|https://github.com/openresty/lua-nginx-module/#lua_regex_cache_max_entries]].
** optimize: [[resty.core.regex|https://github.com/openresty/lua-resty-core#restycoreregex]]: removed one obsolete assertion that was for a LuaJIT bug (already fixed).
* upgraded LuaRestyDNSLibrary to 0.12.
** feature: added support for the SRV resource record type (see [[RFC 2782|http://www.ietf.org/rfc/rfc2782.txt]]). thanks Torbjörn Norinder for the patch.
* upgraded LuaRestyUpstreamHealthcheckLibrary to 0.02.
** bugfix: for bad status lines, we could throw out the "bad argument #2 to 'sub'" error, reported by George Bashi.
** doc: avoided using the {{{\r\n}}} sequence in Lua long brackets because Lua would squeeze it to {{{\n}}}, unfortunately. thanks George Bashi for the report.
** doc: made it clear that multiple {{{upstream {} }}} blocks' checkers can share a single shm zone. thanks Robert Paprocki for asking.
** doc: now we need to turn off [[lua_socket_log_errors|https://github.com/openresty/lua-nginx-module/#lua_socket_log_errors]] explicitly in code examples.
* upgraded LuaRestyLrucacheLibrary to 0.02.
** feature: added an alternative implementation using ~FFI-based hash-table in the form of the new class {{{resty.lrucache.pureffi}}}, which is much faster than the default {{{resty.lrucache}}} class when there are a lot of key variations. thanks Shuxin Yang for the patch.
* upgraded LuaNginxModule to 0.9.10.
** feature: [[stream-typed cosockets|https://github.com/openresty/lua-nginx-module#ngxsockettcp]] are now full-duplex: a reader "[[light thread|https://github.com/openresty/lua-nginx-module#ngxthreadspawn]]" and a writer "light thread" can operate on the same cosocket simultaneously. thanks shun zhang and aviramc for the original patches.
** feature: added new API function [[ngx.thread.kill()|https://github.com/openresty/lua-nginx-module/#ngxthreadkill]] for killing a user "light thread". thanks aviramc for the original patch.
** bugfix: the "coroutine" module table introduced by {{{require('coroutine')}}} was not working in our Lua context. thanks Paul K and ~Pierre-Yves Gérardy for the report.
** bugfix: fixed the initial size of the ngx.worker table and the misleading comment due to a copy&paste mistake. thanks Suraj Jaiswal for the report.
** bugfix: the "coctx cleanup" handler might not be called before being overidden by other operations. this could happen when failing to yield in an error handler (for [[xpcall|http://www.lua.org/manual/5.1/manual.html#pdf-xpcall]]).
** bugfix: fixed an incorrect error message. thanks doujiang for the patch.
** bugfix: fixed a compilation error regression when using the Microsoft Visual C/C++ compiler. thanks itpp16 for the patch.
** bugfix: we should use {{{c->buffered & NGX_HTTP_LOWLEVEL_BUFFERED}}} instead of {{{c->buffered}}} for testing if the downstream connection is busy writing.
** bugfix: we did not handle an out-of-memory case in [[ngx.req.set_body_data()|http://wiki.nginx.org/HttpLuaModule#ngx.req.set_body_data]].
** bugfix: ngx_http_lua_chain_get_free_buf(): avoided returning zero-sized memory bufs.
** bugfix: [[body_filter_by_lua*|https://github.com/openresty/lua-nginx-module#body_filter_by_lua]]: we might incorrectly pass zero-size bufs (in the form of "special sync bufs") at the beginning of a chain, which could get stuck in the buffer of {{{ngx_http_writer_filter_module}}} (or in other words, being "busy") while could still get recycled in the content handler (like [[content_by_lua|https://github.com/openresty/lua-nginx-module#content_by_lua]]), leading to buffer corruptions. thanks westhood for the report and patch.
** bugfix: we did not clear all the fields in the {{{ngx_buf_t}}} C struct when recycling chain link buffers.
** bugfix: the {{{*_by_lua_file}}} directives failed to load .lua files of exactly the size {{{n*LUAL_BUFFERSIZE}}} bytes with the error "'end' expected (to close 'function' at line 1) near '<eof>'". thanks kworr for the report.
** change: now we always iterate through all the user light threads to ensure all threads are de-anchored even when the "uthreads" counter gets out of sync. also added an assertion on the "uthreads" counter.
** change: now we turn off our C-land assertions by default unless the user explicitly specifies the C compiler option {{{-DNGX_LUA_USE_ASSERT}}}.
** change: throw out the "no memory" Lua error consistently (instead of "out of memory") when failing to allocate on the nginx side.
** change: we now still call {{{ngx_pfree()}}} in our own {{{pcre_free}}} hook.
** doc: documented the {{{NGX_LUA_USE_ASSERT}}} and {{{NGX_LUA_ABORT_AT_PANIC}}} C macros.
** doc: added performance notes to the sections for the [[ngx.var|https://github.com/openresty/lua-nginx-module#ngxvarvariable]] and [[ngx.ctx|https://github.com/openresty/lua-nginx-module#ngxctx]] API.
** doc: documented the types of Lua values that can be passed to the [[ngx.timer|https://github.com/openresty/lua-nginx-module#ngxtimerat]] callback functions.
* upgraded FormInputNginxModule to 0.09.
** bugfix: fixed warnings from the Microsoft Visual C/C++ compiler. thanks itpp16 for the report.
* upgraded EchoNginxModule to 0.54.
** bugfix: the "unknown option for echo_subrequest_async" error was thrown when Nginx variables were used in both the "method" argument and URI argument of the [[echo_subrequest|https://github.com/openresty/echo-nginx-module#echo_subrequest]] directive (and etc). thanks Utkarsh Upadhyay for the report.
** bugfix: fixed a misleading error message.
* upgraded SrcacheNginxModule to 0.28.
** feature: log an error message when [[srcache_store|http://wiki.nginx.org/HttpSRCacheModule#srcache_store]] subrequest has an error or returns a bad HTTP status code. thanks Yann Coleu for the report.
** doc: typo fix from javasboy.
* upgraded MemcNginxModule to 0.15.
** bugfix: we did not log error messages for invalid values of {{{$memc_flags}}}, {{{$memc_exptime}}}, and {{{$memc_value}}}, leading to hard-to-debug HTTP 400 status errors. thanks Yann Coleu for the report.
* bugfix: {{{./configure --without-lua_resty_dns}}} did not work as declared. thanks Vitaly for the report.
* bugfix: use {{{cc}}} as the default C compiler for LuaJIT and Lua C libraries because modern ~FreeBSD 10 has no gcc by default and its clang is already featureful enough to compile everything. thanks Stefan Parvu for the suggestion.
* change: {{{./configure --with-debug}}} now also passes the extra C compiler options {{{-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC}}} to the LuaNginxModule build.
See ChangeLog1007000 for change log for OpenResty 1.7.0.x.
<<toolbar permalink>>
! Stable Release 0.8.54.9 - 8 July 2011
This release is the same as  0.8.54.9rc6.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.02
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.1.0
* echo-nginx-module-0.36
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc4
* headers-more-nginx-module-0.15
* iconv-nginx-module-0.10rc3
* lua-5.1.4
* memc-nginx-module-0.12
* nginx-0.8.54
* ngx_devel_kit-0.2.17
* ngx_lua-0.2.0
* ngx_postgres-0.8
* rds-json-nginx-module-0.11
* redis2-nginx-module-0.07rc5
* set-misc-nginx-module-0.21
* srcache-nginx-module-0.12rc6
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 0.8.54.9rc6 - 8 July 2011
* upgraded ngx_echo to v0.36 and ngx_memc to v0.12.
! Mainline Version 0.8.54.9rc5 - 7 July 2011
* applied the subrequest loop fix patch from Maxim Dounin.
! Mainline Version 0.8.54.9rc4 - 6 July 2011
* upgraded ngx_rds_json to v0.11, ngx_headers_more to v0.15, and ngx_drizzle to v0.1.0.
! Mainline Version 0.8.54.9rc3 - 5 July 2011
* upgraded ngx_drizzle to 0.0.15rc14 and ngx_lua to 0.2.0.
! Mainline Version 0.8.54.9rc2 - 4 July 2011
* upgraded ngx_lua to 0.1.6rc18.
! Mainline Version 0.8.54.9rc1 - 3 July 2011
* upgraded ngx_redis2 to 0.07rc5.
! Stable Release 0.8.54.8 - 1 July 2011
This release is the same as  0.8.54.8rc2.

The following components are bundled by this release:
* ~LuaJIT-2.0.0-beta8
* array-var-nginx-module-0.02
* auth-request-nginx-module-0.2
* drizzle-nginx-module-0.0.15rc13
* echo-nginx-module-0.36rc6
* encrypted-session-nginx-module-0.01
* form-input-nginx-module-0.07rc4
* headers-more-nginx-module-0.15rc3
* iconv-nginx-module-0.10rc3
* lua-5.1.4
* memc-nginx-module-0.12rc2
* nginx-0.8.54
* ngx_devel_kit-0.2.17
* ngx_lua-0.1.6rc17
* ngx_postgres-0.8
* rds-json-nginx-module-0.11rc2
* redis2-nginx-module-0.07rc4
* set-misc-nginx-module-0.21
* srcache-nginx-module-0.12rc6
* upstream-keepalive-nginx-module-0.3
* xss-nginx-module-0.03rc3
! Mainline Version 0.8.54.8rc2 - 1 July 2011
* upgraded ngx_echo to 0.36rc6, ngx_lua to 0.1.6rc17, ngx_srcache to 0.12rc6, and ngx_redis2 to 0.07rc4.
! Mainline Version 0.8.54.8rc1 - 28 June 2011
* we no longer bundle libdrizzle because [[libdrizzle 1.0|https://launchpad.net/libdrizzle]] is distributed with the drizzle server and hard to separate.
* now ngx_drizzle is disabled by default. you need to enable it via the {{{--with-http_drizzle_module}}} option.
* added {{{--with-libdrizzle}}} option to specify the (lib)drizzle installation prefix.
! Stable Release 0.8.54.7 - 27 June 2011
* identical to 0.8.54.7rc5.
! Mainline Version 0.8.54.7rc5 - 27 June 2011
* we should preserve timestamps when copying bundle/ to build/ in ./configure script. this should fix luajit build on some systems.
! Mainline Version 0.8.54.7rc4 - 27 June 2011
upgraded ngx_xss to 0.03rc3, ngx_drizzle to 0.0.15rc11, ngx_memc to 0.12rc2, ngx_srcache to 0.12rc5, ngx_redis2 to 0.07rc3.
! Mainline Version 0.8.54.7rc3 - 27 June 2011
* upgraded LuaJIT to 2.0.0beta8, ngx_lua to 0.1.6rc15, and ngx_echo to 0.36rc4.
! Mainline Version 0.8.54.7rc2
* Upgraded [[LuaNginxModule]] to v0.1.6rc14 and [[HeadersMoreNginxModule]] to v0.15rc3.
! Mainline Version 0.8.54.7rc1
* Upgraded [[HeadersMoreNginxModule]] to v0.15rc2 and [[LuaNginxModule]] to v0.1.6rc13.
! Release 0.8.54.6
* Upgraded [[DrizzleNginxModule]] to 0.0.15rc10.
* Upgraded [[LuaNginxModule]] to 0.1.6rc12.
* Upgraded [[Redis2NginxModule]] to 0.07rc2.
! Release 0.8.54.5
* Upgraded [[EchoNginxModule]] to 0.36rc3.
* Upgraded [[LuaNginxModule]] to 0.1.6rc9.
<<toolbar permalink>>
* [[Release 1.7.2.x|ChangeLog1007002]]
* [[Release 1.7.0.x|ChangeLog1007000]]
* [[Release 1.5.12.x|ChangeLog1005012]]
* [[Release 1.5.11.x|ChangeLog1005011]]
* [[Release 1.5.8.x|ChangeLog1005008]]
* [[Release 1.4.3.x|ChangeLog1004003]]
* [[Release 1.4.2.x|ChangeLog1004002]]
* [[Release 1.4.1.x|ChangeLog1004001]]
* [[Release 1.2.8.x|ChangeLog1002008]]
* [[Release 1.2.7.x|ChangeLog1002007]]
* [[Release 1.2.6.x|ChangeLog1002006]]
* [[Release 1.2.4.x|ChangeLog1002004]]
* [[Release 1.2.3.x|ChangeLog1002003]]
* [[Release 1.2.1.x|ChangeLog1002001]]
* [[Release 1.0.15.x|ChangeLog1000015]]
* [[Release 1.0.11.x|ChangeLog1000011]]
* [[Release 1.0.10.x|ChangeLog1000010]]
* [[Release 1.0.9.x|ChangeLog1000009]]
* [[Release 1.0.8.x|ChangeLog1000008]]
* [[Release 1.0.6.x|ChangeLog1000006]]
* [[Release 1.0.5.x|ChangeLog1000005]]
* [[Release 1.0.4.x|ChangeLog1000004]]
* [[Release 0.8.54.x|ChangeLog8054]]
Background: #fff
Foreground: #000
PrimaryPale: #effa72
PrimaryLight: #007E00
PrimaryMid: #007E00
PrimaryDark: #145D00
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #bd4
SecondaryDark: #04859d
TertiaryPale: #c9f76f
TertiaryLight: #60d5ac
TertiaryMid: #00a383
TertiaryDark: #666
Error: #f88
<<toolbar permalink>>
! Mailing Lists
!! English Mailing List
* Post Archive: http://groups.google.com/group/openresty-en
* Subscribing: send an empty email to {{{openresty-en+subscribe@googlegroups.com}}}
* Posting: send emails to {{{openresty-en@googlegroups.com}}}
* Unsuscribing: send emails to {{{openresty-en+unsubscribe@googlegroups.com}}}
!! Chinese Mailing List
* Post Archive: http://groups.google.com/group/openresty
* Subscribing: send an empty email to {{{openresty+subscribe@googlegroups.com}}}
* Posting: send emails to {{{openresty@googlegroups.com}}}
* Unsuscribing: send emails to {{{openresty+unsubscribe@googlegroups.com}}}
<<toolbar permalink>>

Below lists all the components bundled in OpenResty. All of the components can be enabled or disabled on need.

Most of the components are enabled by default, some are not.

The standard Lua 5.1 interpreter, [[DrizzleNginxModule]], [[PostgresNginxModule]], and [[IconvNginxModule]] are not enabled by default. You need to specify the {{{--with-lua51}}}, {{{--with-http_drizzle_module}}}, {{{--with-http_postgres_module}}}, and {{{--with-http_iconv_module}}} options, respectively, to enable them while [[building OpenResty|Installation]].

Before the 1.5.8.1 release, the standard Lua 5.1 interpreter is enabled by default while LuaJIT 2.x is not. So for earlier releases, you need to explicitly specify the {{{--with-luajit}}} option (which is the default for 1.5.8.1+) to use LuaJIT 2.x.

* [[LuaJIT]]
* [[ArrayVarNginxModule]]
* [[AuthRequestNginxModule]]
* [[CoolkitNginxModule]]
* [[DrizzleNginxModule]]
* [[EchoNginxModule]]
* [[EncryptedSessionNginxModule]]
* [[FormInputNginxModule]]
* [[HeadersMoreNginxModule]]
* [[IconvNginxModule]]
* [[StandardLuaInterpreter]]
* [[MemcNginxModule]]
* [[Nginx]]
* [[NginxDevelKit]]
* [[LuaCjsonLibrary]]
* [[LuaNginxModule]]
* [[LuaRdsParserLibrary]]
* [[LuaRedisParserLibrary]]
* [[LuaRestyCoreLibrary]]
* [[LuaRestyDNSLibrary]]
* [[LuaRestyLockLibrary]]
* [[LuaRestyLrucacheLibrary]]
* [[LuaRestyMemcachedLibrary]]
* [[LuaRestyMySQLLibrary]]
* [[LuaRestyRedisLibrary]]
* [[LuaRestyStringLibrary]]
* [[LuaRestyUploadLibrary]]
* [[LuaRestyUpstreamHealthcheckLibrary]]
* [[LuaRestyWebSocketLibrary]]
* [[LuaUpstreamNginxModule]]
* [[PostgresNginxModule]]
* [[RdsCsvNginxModule]]
* [[RdsJsonNginxModule]]
* [[RedisNginxModule]]
* [[Redis2NginxModule]]
* [[SetMiscNginxModule]]
* [[SrcacheNginxModule]]
* [[XssNginxModule]]
<<toolbar permalink>>

You can join the [[OpenResty Community|Community]].

Reporting bugs are encouraged to file tickets for the ngx_openresty project on GitHub:

https://github.com/agentzh/ngx_openresty/issues

Alternatively you can send mails privately to [[agentzh|http://agentzh.org]]: agentzh at gmail dot com.
<<toolbar permalink>>

This module is collection of small and useful Nginx add-ons.

Project homepage and documentation: https://github.com/FRiCKLE/ngx_coolkit/

This module is enabled by default and could be disabled by passing {{{--without-http_coolkit_module}}} option to OpenResty's {{{./configure}}} script.
<<toolbar permalink>>

You should always check out Nginx's error log file (specified by the {{{error_log}}} directive in {{{nginx.conf}}}) for any errors or warnings.

If you prefer redirecting common Lua errors to the HTTP response body during Lua development, you can put a Lua [[pcall|http://www.lua.org/manual/5.1/manual.html#pdf-pcall]] call on the top level of your Lua code to catch and redirect any Lua exceptions. But keep in mind, not all errors can be captured this way because you could have errors when sending out the response, then it is impossible to put such errors into the response body.

During Lua code development, you can disable the [[Lua code cache|http://wiki.nginx.org/HttpLuaModule#lua_code_cache]] temporarily so that you do not have to reload the Nginx server for your (external) Lua code changes to take effect.

Also, it is strongly recommended to follow the test-driven development workflow. For example, LuaRestyRedisLibrary uses the [[Test::Nginx|http://search.cpan.org/perldoc?Test%3A%3ANginx]] test scaffold to drive its (declarative) [[test suite|https://github.com/agentzh/lua-resty-redis/tree/master/t/]].

If you are on Linux, there are quite many real-time analysing tools based on [[systemtap|http://sourceware.org/systemtap/]], which can be used to inspect a running Nginx worker process in various ways:
:https://github.com/agentzh/nginx-systemtap-toolkit
You can find additional tools in the stap++ project:
:https://github.com/agentzh/stapxx
These tools can not only debug functional problems, but also profile online servers to find performance bottlenecks.
[[OpenResty]] [[About]]
<<toolbar permalink>>

! Donate With ~PayPal

If you'd like to make a one-time donation to OpenResty, you can use ~PayPal to make it fast and easy.

* ~PayPal members can donate directly from their ~PayPal accounts by logging in via the ~PayPal website and clicking "send money" to {{{agentzh@gmail.com}}}, or just click the button below.
* ~Non-PayPal members can still pay with a credit card without signing up for ~PayPal. Click the button below then follow the instructions at the bottom of the page for non-~PayPal members.

<html>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="agentzh@gmail.com">
<input type="hidden" name="item_name" value="OpenResty Donation (in USD)">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="">
<input type="image" src="donate_button_paypal_01.gif" border="0" name="submit" alt="Donate with PayPal">
</form>
</html>

! Donate with ~AliPay (支付宝)

If you're in China, it's usually more convenient to send donation is to send money via the [[AliPay|http://www.alipay.com/]] to my account {{{agentzh@yahoo.cn}}} or just click the following button:

<html>
<a href="http://me.alipay.com/agentzh" target="_blank"><img src="donate-with-alipay.png"></a>
</html>

Any amount will be highly appreciated!
<<toolbar permalink>>
You can download the latest release tarball below. After that, you can follow the instructions on the [[Installation]] page to build and install it.
!Releases
!! Lastest release
* [[ngx_openresty-1.7.2.1.tar.gz|http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz]] &nbsp; 3.2MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.7.2.1.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1007002]] - 12 July 2014
!! Legacy releases
Sometimes, users may want to download old releases.
* [[ngx_openresty-1.7.0.1.tar.gz|http://openresty.org/download/ngx_openresty-1.7.0.1.tar.gz]] &nbsp; 3.1MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.7.0.1.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1007000]] - 7 June 2014
* [[ngx_openresty-1.5.12.1.tar.gz|http://openresty.org/download/ngx_openresty-1.5.12.1.tar.gz]] &nbsp; 3.1MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.5.12.1.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1005012]] - 29 April 2014
* [[ngx_openresty-1.5.11.1.tar.gz|http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz]] &nbsp; 3.1MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.5.11.1.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1005011]] - 30 March 2014
* [[ngx_openresty-1.5.8.1.tar.gz|http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz]] &nbsp; 3.1MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.5.8.1.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1005008]] - 10 January 2014
* [[ngx_openresty-1.4.3.6.tar.gz|http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz]] &nbsp; 3.1MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.4.3.6.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1004003]] - 20 November 2013
* [[ngx_openresty-1.4.3.4.tar.gz|http://openresty.org/download/ngx_openresty-1.4.3.4.tar.gz]] &nbsp; 3.1MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.4.3.4.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1004003]] - 12 November 2013
* [[ngx_openresty-1.4.2.8.tar.gz|http://openresty.org/download/ngx_openresty-1.4.2.8.tar.gz]] &nbsp; 3.0MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.4.2.8.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1004002]] - 22 September 2013
* [[ngx_openresty-1.2.8.6.tar.gz|http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.8.6.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002008]] - 10 June 2013
* [[ngx_openresty-1.2.7.8.tar.gz|http://openresty.org/download/ngx_openresty-1.2.7.8.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.7.8.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002007]] - 13 May 2013
* [[ngx_openresty-1.2.7.6.tar.gz|http://openresty.org/download/ngx_openresty-1.2.7.6.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.7.6.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002007]] - 17 April 2013
* [[ngx_openresty-1.2.6.6.tar.gz|http://openresty.org/download/ngx_openresty-1.2.6.6.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.6.6.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002006]] - 17 February 2013
* [[ngx_openresty-1.2.4.14.tar.gz|http://openresty.org/download/ngx_openresty-1.2.4.14.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.4.14.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002004]] - 23 December 2012
* [[ngx_openresty-1.2.3.8.tar.gz|http://openresty.org/download/ngx_openresty-1.2.3.8.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.3.8.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002003]] - 8 October 2012
* [[ngx_openresty-1.2.1.14.tar.gz|http://openresty.org/download/ngx_openresty-1.2.1.14.tar.gz]] &nbsp; 2.9MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.2.1.14.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1002001]] - 14 August 2012
* [[ngx_openresty-1.0.15.10.tar.gz|http://openresty.org/download/ngx_openresty-1.0.15.10.tar.gz]] &nbsp; 2.7MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.15.10.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000015]] - 13 June 2012
* [[ngx_openresty-1.0.11.28.tar.gz|http://openresty.org/download/ngx_openresty-1.0.11.28.tar.gz]] &nbsp; 2.7MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.11.28.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000011]] - 25 March 2012
* [[ngx_openresty-1.0.10.48.tar.gz|http://openresty.org/download/ngx_openresty-1.0.10.48.tar.gz]] &nbsp; 2.6MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.10.48.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000010]] - 1 February 2012
* [[ngx_openresty-1.0.10.44.tar.gz|http://openresty.org/download/ngx_openresty-1.0.10.44.tar.gz]] &nbsp; 2.5MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.10.44.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000010]] - 16 January 2012
* [[ngx_openresty-1.0.10.24.tar.gz|http://openresty.org/download/ngx_openresty-1.0.10.24.tar.gz]] &nbsp; 2.5MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.10.24.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000010]] - 11 December 2011
* [[ngx_openresty-1.0.9.10.tar.gz|http://openresty.org/download/ngx_openresty-1.0.9.10.tar.gz]] &nbsp; 2.5MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.9.10.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000009]] - 16 November 2011
* [[ngx_openresty-1.0.8.26.tar.gz|http://openresty.org/download/ngx_openresty-1.0.8.26.tar.gz]] &nbsp; 2.5MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.8.26.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000008]] - 3 November 2011
* [[ngx_openresty-1.0.6.22.tar.gz|http://openresty.org/download/ngx_openresty-1.0.6.22.tar.gz]] &nbsp; 2.4MB &nbsp; [[PGP|http://openresty.org/download/ngx_openresty-1.0.6.22.tar.gz.asc]] &nbsp; [[Changes|ChangeLog1000006]] - 7 October 2011

See [[Installation]] for installation instructions.
<<toolbar permalink>>

This is an nginx upstream module that talks to ~MySQL and/or Drizzle database servers by [[libdrizzle]].

This ngx_drizzle module is not enabled by default. You should specify the {{{--with-http_drizzle_module}}} option while configuring OpenResty.

The [[libdrizzle]] C library is no longer bundled by OpenResty. You need to download the drizzle server tarball from https://launchpad.net/drizzle.

Latest drizzle7 release does not support building libdrizzle 1.0 separately and requires a lot of external dependencies like Boost and Protobuf which are painful to install. The last version supporting building libdrizzle 1.0 separately is {{{2011.07.21}}}. You can download it from here:

http://openresty.org/download/drizzle7-2011.07.21.tar.gz

When you get the drizzle7 2011.07.21 release tarball, you can install libdrizzle-1.0 like this:
{{{
tar xzvf drizzle7-2011.07.21.tar.gz
cd drizzle7-2011.07.21/
./configure --without-server
make libdrizzle-1.0
make install-libdrizzle-1.0
}}}

Please ensure that you have the {{{python}}} command point to a {{{python2}}} interpreter. It's known that on recent Arch Linux distribution, {{{python}}} is linked to {{{python3}}} by default, and while running {{{make libdrizzle-1.0}}} will yield the following error:
{{{
  File "config/pandora-plugin", line 185
    print "Dependency loop detected with %s" % plugin['name']
                                           ^
SyntaxError: invalid syntax
make: *** [.plugin.scan] Error 1
}}}
You can fix this by pointing {{{python}}} temporarily to {{{python2}}}.

When you install the libdrizzle-1.0 library to a custom path prefix, you can specify the libdrizzle prefix to OpenResty like this:
{{{
cd /path/to/ngx_openresty-VERSION/
./configure --with-libdrizzle=/path/to/drizzle --with-http_drizzle_module
}}}

Documentation page: https://github.com/chaoslawful/drizzle-nginx-module#readme

Project page: https://github.com/chaoslawful/drizzle-nginx-module

When used in conjunction with [[LuaNginxModule]], it is recommended to use [[LuaRestyMySQLLibrary]] instead of this one, since it is more flexible and more memory-efficient.
<<toolbar permalink>>

This sample demonstrates how to use Redis to route incoming requests to different HTTP backends based on the requests' {{{User-Agent}}} header.

This demo uses the components LuaNginxModule and LuaRestyRedisLibrary enabled by default in OpenResty.

Here's the complete code listing for our {{{nginx.conf}}}:

{{{
worker_processes  2;
error_log logs/error.log info;

events {
    worker_connections 1024;
}

http {
    server {
        listen 8080;

        location / {
            resolver 8.8.4.4;  # use Google's open DNS server

            set $target '';
            access_by_lua '
                local key = ngx.var.http_user_agent
                if not key then
                    ngx.log(ngx.ERR, "no user-agent found")
                    return ngx.exit(400)
                end

                local redis = require "resty.redis"
                local red = redis:new()

                red:set_timeout(1000) -- 1 second

                local ok, err = red:connect("127.0.0.1", 6379)
                if not ok then
                    ngx.log(ngx.ERR, "failed to connect to redis: ", err)
                    return ngx.exit(500)
                end

                local host, err = red:get(key)
                if not host then
                    ngx.log(ngx.ERR, "failed to get redis key: ", err)
                    return ngx.exit(500)
                end

                if host == ngx.null then
                    ngx.log(ngx.ERR, "no host found for key ", key)
                    return ngx.exit(400)
                end

                ngx.var.target = host
            ';

            proxy_pass http://$target;
        }
    }
}
}}}

And then let's start the redis server on the localhost:6379:
{{{
$ ./redis-server  # default port is 6379
}}}

and feed some keys into this using the redis-cli utility:
{{{
   $ ./redis-cli
   redis> set foo apache.org
   OK
   redis> set bar nginx.org
   OK
}}}
And then let's test our nginx app!
{{{
   $ curl --user-agent foo localhost:8080
   <apache.org home page goes here>

   $ curl --user-agent bar localhost:8080
   <nginx.org home page goes here>
}}}
To further tune the performance, one could enable the connection pool for the redis connections, as documented in LuaRestyRedisLibrary's README.

Before you benchmarking your interface defined here, please ensure that you've raised the error log level to {{{warn}}} or {{{notice}}} in your {{{nginx.conf}}} file, as in
{{{
error_log logs/error.log warn;
}}}
because flushing error log is a very expensive operation and can hurt performance a lot.
<<toolbar permalink>>

This module wraps lots of Nginx internal ~APIs for streaming input and output, parallel/sequential subrequests, timers and sleeping, as well as various meta data accessing.

Basically it provides various utilities that help testing and debugging of other modules by trivially emulating different kinds of faked subrequest locations.

Documentation: https://github.com/agentzh/echo-nginx-module#readme

Project page: https://github.com/agentzh/echo-nginx-module
<<toolbar permalink>>

This module provides encryption and decryption support for [[Nginx]] variables based on ~AES-256 with Mac.

This module is usually used with [[SetMiscNginxModule]] and the standard [[rewrite module|http://wiki.nginx.org/NginxHttpRewriteModule]]'s directives.

This module can be used to implement simple user login and access control of web applications.

Project page: http://github.com/agentzh/encrypted-session-nginx-module
This is a standard Nginx module for talking to the remote FastCGI servers: http://wiki.nginx.org/HttpFastcgiModule
<<toolbar permalink>>

This is an [[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.

Project page: https://github.com/calio/form-input-nginx-module
<<toolbar permalink>>

The OpenResty project has a loose organization. Most of the components are self-contained open-source projects and are developed separately. They all have their own code repositories, their own test suites, or even their own maintainers. The maintainer of the OpenResty bundle, [[agentzh|YichunZhang]], is also maintaining most of the components included.

The [[ngx_openresty GitHub repository|https://github.com/agentzh/ngx_openresty/]] only contains the facilities to generate a tarball from all the components' releases for the bundle itself.

You can contribute patches or report bugs to each of the component separately. Please check out the [[Components]] page for more details about each component project.

For example, one of the core components, LuaNginxModule, has its official code repository hosted on GitHub as well: https://github.com/chaoslawful/lua-nginx-module

Another core component, the Nginx core, is developed by the [[Nginx company|http://nginx.com]]. And the opensource development of the Nginx core usually happens on the official [[nginx-devel mailing list|http://mailman.nginx.org/mailman/listinfo/nginx-devel]]. But also keep in mind that the OpenResty bundle also maintains [[a set of small patches|https://github.com/agentzh/ngx_openresty/tree/master/patches/]] for the Nginx core to fix some urgent bugs or add a few really important features that must reside in the core.

Discussions not specific to the Nginx core should happen on the [[openresty-en mailing list|https://groups.google.com/group/openresty-en]] (or the [[openresty Chinese mailing list|https://groups.google.com/group/openresty]]). See the [[Community]] page for more details. You are always welcome to join us there.

The maintainer of the OpenResty bundle periodically runs a big test cluster on [[Amazon EC2|http://aws.amazon.com/ec2/]] where the test suite of each component bundled is run against the latest Nginx releases. You can always check out the test reports on the [[qa.openresty.org site|http://qa.openresty.org]].
<<toolbar permalink>>

First of all, please go to the [[Download]] page to get the source code tarball of OpenResty, and see the [[Installation]] page for how to build and install it into your system.

!~HelloWorld
!!Prepare directory layout
We first create a separate directory for our experiments. You can use an arbitrary directory. Here for simplicity, we just use {{{~/work}}}:
{{{
mkdir ~/work
cd ~/work
mkdir logs/ conf/
}}}
Note that we've also created the {{{logs/}}} directory for logging files and {{{conf/}}} for our config files.
!!Prepare the nginx.conf config file
Create a simple plain text file named {{{conf/nginx.conf}}} with the following contents in it:
{{{
worker_processes  1;
error_log logs/error.log;
events {
    worker_connections 1024;
}
http {
    server {
        listen 8080;
        location / {
            default_type text/html;
            content_by_lua '
                ngx.say("<p>hello, world</p>")
            ';
        }
    }
}
}}}
If you're familiar with Nginx configuration, it should look very familiar to you. OpenResty is just an enhanced version of Nginx by means of addon modules anyway. You can take advantage of all the existing goodies in the Nginx world.
!!Start the Nginx server
Assuming you have installed OpenResty into {{{/usr/local/openresty}}} (this is the default), we make our {{{nginx}}} executable of our OpenResty installation available in our {{{PATH}}} environment:
{{{
PATH=/usr/local/openresty/nginx/sbin:$PATH
export PATH
}}}
Then we start the nginx server with our config file this way:
{{{
nginx -p `pwd`/ -c conf/nginx.conf
}}}
Error messages will go to the stderr device or the default error log files {{{logs/error.log}}} in the current working directory.
!!Access our ~HelloWorld web service
We can use curl to access our new web service that says ~HelloWorld:
{{{
curl http://localhost:8080/
}}}
If everything is okay, we should get the output
{{{
<p>hello, world</p>
}}}
You can surely point your favorite web browser to the location {{{http://localhost:8080/}}}.
!!Test performance
See [[Benchmark]] for details.

!Where to go from here

View the documentation of each component at the [[Components]] page and find Nginx related stuffs on the [[Nginx Wiki site|http://wiki.nginx.org/]].
~GitHub is social coding network based on git, a very popular version control system. See its homepage: http://github.com.
This module allows you to add, set, or clear any response or request headers that you specify.

This is an enhanced version of the standard headers module because it provides more utilities like resetting or clearing "builtin headers" like ~Content-Type, ~Content-Length, and Server. 

Documentation: https://github.com/agentzh/headers-more-nginx-module#readme
Project page: http://github.com/agentzh/headers-more-nginx-module
<<toolbar permalink>>

This is an [[Nginx]] module that uses libiconv to convert characters of different encoding. It brings the {{{set_iconv}}} and {{{iconv_filter}}} commands to [[Nginx]].

It can either process Nginx variables or process response bodies as an output filter.

This module is not enabled by default, and you need to specify the {{{--with-http_iconv_module}}} option while [[building OpenResty|Installation]]. This Nginx module requires libiconv to be installed into your system.

Use cases: http://forum.nginx.org/read.php?2,206658,207119

Project page: https://github.com/calio/iconv-nginx-module
<<toolbar permalink>>
If you haven't downloaded the OpenResty source code tarball, please go to the [[Download]] page first.

Basically, building and installing OpenResty is as simple as
{{{
tar xzvf ngx_openresty-VERSION.tar.gz
cd ngx_openresty-VERSION/
./configure
make
make install
}}}
where {{{VERSION}}} should be replaced by a concrete version number of OpenResty, like {{{0.8.54.6}}}.

If your system environment is modern enough, then you almost always want to enable the PCRE JIT support and ~IPv6 support in your NGINX by passing the {{{--with-pcre-jit}}} and {{{--with-ipv6}}} options to the {{{./configure}}} script.

If you have problems while building or want finer control over the building process, please read on.
!Prerequisites
You should have {{{perl 5.6.1+}}}, {{{libreadline}}}, {{{libpcre}}}, {{{libssl}}} installed into your system. For Linux, you should also ensure that {{{ldconfig}}} is in your PATH environment.
!!Debian and Ubuntu users
You're recommended to install the following packages using apt-get:
{{{
apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make
}}}
!!Fedora and ~RedHat users
You're recommended to install the following packages using yum:
{{{
yum install readline-devel pcre-devel openssl-devel
}}}
!!Mac OS X (Darwin) users
You're recommended to install prerequisites PCRE using some package management tool, like [[Homebrew|http://mxcl.github.com/homebrew/]]:
{{{
brew install pcre
}}}
Alternatively you can install PCRE from source all by yourself :)

After installing PCRE, you may need to specify the paths for PCRE's headers and libraries to your C compiler and linker, for example,
{{{
$ ./configure \
             --with-cc-opt="-I/usr/local/include" \
             --with-ld-opt="-L/usr/local/lib" \
             ...
}}}
assuming that your PCRE is installed under the prefix {{{/usr/local/}}}.

See also [[Issue #3|https://github.com/agentzh/ngx_openresty/issues/3]].

!!~FreeBSD users
You need to install the following ports:
* devel/gmake
* security/openssl
* devel/pcre
!!Solaris 11 users
You need to install the following packages from the official repository:
* gcc-3
* ~SUNWlibm
Usually it's just as simple as
{{{
pfexec pkg install gcc-3 SUNWlibm
}}}
!Build ~OpenResty
!!Download
download the latest ngx_openresty tarball can be fetched from the [[Download]] page and unpack it like this:
{{{
tar xzvf ngx_openresty-VERSION.tar.gz
}}}
where {{{VERSION}}} should be replaced by real version numbers like {{{0.8.54.6}}}.
!!./configure
Then enter the {{{ngx_openresty-VERSION/}}} directory, and type the following command to configure:
{{{
./configure
}}}
By default, {{{--prefix=/usr/local/openresty}}} is assumed. You should only disable LuaJIT 2 when your platform does not support LuaJIT.

You can specify various options, as in
{{{
./configure --prefix=/opt/openresty \
            --with-pcre-jit \
            --with-ipv6 \
            --without-http_redis2_module \
            --with-http_iconv_module \
            --with-http_postgres_module \
            -j2
}}}
All of the Nginx configure file options can be used here, including {{{--add-module=PATH}}}. Try {{{./configure --help}}} to see more options available.

Errors in running the ./configure script can be found in the file {{{build/nginx-VERSION/objs/autoconf.err}}} where {{{VERSION}}} should be replaced by a concrete version number of OpenResty, like {{{0.8.54.6}}}.
!!!Notes for Solaris users
For Solaris, it's common to install libraries like ~OpenSSL to {{{/lib}}}, so when it complaints about missing ~OpenSSL and you have indeed already installed it, specify the {{{--with-ld-opt='-L/lib'}}} option.
!!make
Now you can compile everything up using the command
{{{
make
}}}
If your machine has multiple cores and your {{{make}}} supports the jobserver feature, you can compile things in parallel like this:
{{{
make -j2
}}}
assuming you have 2 CPU cores.
!!make install
If all the previous steps go without problems, you can install OpenResty into your system by typing the command
{{{
make install
}}}
On Linux, it often requires {{{sudo}}} to gain root access.
<<toolbar permalink>>

Lua CJSON is a Lua C module that provides fast JSON parsing and encoding support for Lua.

Project homepage: http://www.kyne.com.au/~mark/software/lua-cjson.php

This library is enabled by default. You can specify the {{{--without-lua_cjson}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

LuaJIT is a ~Just-In-Time Compiler for the Lua programming language. 

Homepage: http://luajit.org/luajit.html

LuaJIT is enabled by default since OpenResty 1.5.8.1. Please explicitly specify the {{{--with-luajit}}} option while configuring OpenResty older than 1.5.8.1. See [[Installation]] for details.
<<toolbar permalink>>

This module embeds the Lua interpreter or LuaJIT 2.0 into the nginx core and integrates the powerful Lua threads (aka Lua coroutines) into the Nginx event model by means of cosockets and Nginx subrequests.

Documentation: https://github.com/chaoslawful/lua-nginx-module#readme

Project page: http://github.com/chaoslawful/lua-nginx-module
<<toolbar permalink>>

This Lua library can be used to parse the ~Resty-DBD-Stream formatted data generated by DrizzleNginxModule and PostgresNginxModule into Lua data structures. In the past, we have to use JSON as the intermediate data format which is quite inefficient in terms of both memory and CPU time.

To maximize speed and minimize memory footprint, this library is implemented in pure C.

This library is enabled by default; use the {{{--without-lua_rds_parser}}} option to disable it when running {{{./configure}}} to build OpenResty.

Project homepage: https://github.com/agentzh/lua-rds-parser
<<toolbar permalink>>

The lua-redis-parser library implements a thin and fast redis raw response parser that constructs corresponding lua data strucutres, as well as a function that constructs redis raw requests.

Documentation page: https://github.com/agentzh/lua-redis-parser#readme

Project homepage: https://github.com/agentzh/lua-redis-parser
<<toolbar permalink>>

Reimplements the Lua API provided by LuaNginxModule with LuaJIT FFI.

Project homepage: https://github.com/openresty/lua-resty-core

This library is enabled by default. You can specify the {{{--without-lua_resty_core}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Nonblocking DNS (Domain Name System) resolver for LuaNginxModule based on the cosocket API.

Project homepage: https://github.com/agentzh/lua-resty-dns

This library is enabled by default. You can specify the {{{--without-lua_resty_dns}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

This Lua library implements a simple nonblocking mutex lock API based on LuaNginxModule's shared memory dictionaries. Mostly useful for eliminating "dog-pile effects".

Project homepage: https://github.com/agentzh/lua-resty-lock

This library is enabled by default. You can specify the {{{--without-lua_resty_lock}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Implements a Lua-land LRU cache for OpenResty.

Project homepage: https://github.com/openresty/lua-resty-lrucache

This library is enabled by default. You can specify the {{{--without-lua_resty_lrucache}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Lua [[Memcached|http://memcached.org/]] client driver for LuaNginxModule based on the cosocket API.

Project homepage: https://github.com/agentzh/lua-resty-memcached

This library is enabled by default. You can specify the {{{--without-lua_resty_memcached}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Lua [[MySQL|http://en.wikipedia.org/wiki/MySQL]] client driver for LuaNginxModule based on the cosocket API.

Project homepage: https://github.com/agentzh/lua-resty-mysql

This library is enabled by default. You can specify the {{{--without-lua_resty_mysql}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Lua [[Redis|http://redis.io/]] client driver for LuaNginxModule based on the cosocket API.

Project homepage: https://github.com/agentzh/lua-resty-redis

This library is enabled by default. You can specify the {{{--without-lua_resty_redis}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

A Lua library that provides string utilities and common hash functions for LuaNginxModule.

Project homepage: https://github.com/agentzh/lua-resty-string

This library is enabled by default. You can specify the {{{--without-lua_resty_string}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Streaming reader and parser for HTTP file uploading based on LuaNginxModule's cosocket API.

Project homepage: https://github.com/agentzh/lua-resty-upload

This library is enabled by default. You can specify the {{{--without-lua_resty_upload}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

Health Checker for Nginx Upstream Servers in Pure Lua.

Project homepage: https://github.com/agentzh/lua-resty-upstream-healthcheck

This library is enabled by default. You can specify the {{{--without-lua_resty_upstream_healthcheck}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

This Lua library implements both a nonblocking ~WebSocket server and a nonblocking ~WebSocket client based on LuaNginxModule's cosocket API.

Project homepage: https://github.com/agentzh/lua-resty-websocket

This library is enabled by default. You can specify the {{{--without-lua_resty_websocket}}} option to OpenResty's {{{./configure}}} script to explicitly disable it.
<<toolbar permalink>>

This Nginx C module exposes a Lua API to LuaNginxModule for classic Nginx upstreams.

Documentation: https://github.com/agentzh/lua-upstream-nginx-module#readme

Project page: https://github.com/agentzh/lua-upstream-nginx-module
[[About]]
[[Overview|OpenResty]]
[[Benchmark]]
[[Changes]]
[[Community]]
[[Components]]
[[Contact us|ContactUs]]
[[Debugging]]
[[Donate Online|DonateOnline]]
[[Download]]
[[eBooks]]
[[Getting Involved|GettingInvolved]]
[[Getting Started|GettingStarted]]
[[Installation]]
[[Presentations]]
[[Profiling]]
[[Quality Assurance|QualityAssurance]]
[[Resources]]
[[Samples]]
[[Upgrading]]
[[中文维基|cn/index.html]]

[img[feed-icon-14x14.png]] [[RSS feed|RSSFeed]]

<html>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="agentzh@gmail.com">
<input type="hidden" name="item_name" value="OpenResty Donation (in USD)">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="">
<input type="image" src="donate_button_paypal_01.gif" border="0" name="submit" alt="Donate with PayPal">
</form>
</html>
<html>
<a href="http://me.alipay.com/agentzh" target="_blank"><img src="donate-with-alipay.png"></a>
</html>
<p/><p/>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-24724965-1']);
  _gaq.push(['_setDomainName', 'openresty.org']);
  _gaq.push(['_trackPageview']);

  var ga_f = function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  };
  setTimeout(ga_f, 200);

</script>

<<toolbar permalink>>

This module extends the standard memcached module  to support almost the whole memcached ascii protocol.

It allows you to define a custom REST interface to your memcached servers or access memcached in a very efficient way from within the nginx server by means of subrequests or independent fake requests. 

Documentation: https://github.com/agentzh/memc-nginx-module#readme

Project page: http://github.com/agentzh/memc-nginx-module

When used in conjunction with [[LuaNginxModule]], it is recommended to use [[LuaRestyMemcachedLibrary]] instead of this one, since it is more flexible and more memory-efficient.
<<toolbar permalink>>

Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/~POP3 proxy server. See its homepage: http://nginx.org.
<<toolbar permalink>>

The NDK is an Nginx module that is designed to extend the core functionality of the    excellent Nginx webserver in a way that can be used as a basis of other Nginx modules.

Project page: https://github.com/simpl/ngx_devel_kit
<<toolbar permalink>>

~OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard [[Nginx]] core, lots of [[3rd-party Nginx modules|http://wiki.nginx.org/3rdPartyModules]], as well as most of their external dependencies.

By taking advantage of various well-designed Nginx modules, ~OpenResty effectively turns the nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing nginx C modules and Lua modules and construct extremely high-performance web applications that are capable to handle 10K+ connections.

~OpenResty aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like ~MySQL, ~PostgreSQL, Memcached, and Redis.

~OpenResty is //not// an Nginx fork. It is just a software bundle. Most of the patches applied to the Nginx core in ~OpenResty have already been submitted to the official Nginx team and most of the patches submitted have also been accepted. We are trying hard //not// to fork Nginx and always to use the latest best Nginx core from the official Nginx team.

See [[Components]] for the complete list of software bundled in ~OpenResty.

See [[GettingStarted]] on how to quickly setup an ~OpenResty server that can say hello world over HTTP. Or you can go to the [[Download]] section to grab ~OpenResty's source code tarball directly.

We provide free technical support in the openresty and openresty-en mailing lists. See [[Community]].
<<toolbar permalink>>

ngx_postgres is an upstream module that allows [[Nginx]] to communicate directly with ~PostgreSQL database.

Response is generated in RDS format, so it's compatible with RdsJsonNginxModule and DrizzleNginxModule modules.

This module is not enabled by default, and you need to specify the {{{--with-http_postgres_module}}} option while [[building OpenResty|Installation]]. This Nginx module requires libpq to be installed into your system.

Project page: http://github.com/FRiCKLE/ngx_postgres
<<toolbar permalink>>

Here goes a list of slides that I used in my talks regarding OpenResty.

These slides are powered by the [[slides.htm|https://github.com/kindy61/slides.htm]] slide-making engine based on AJAX.

''//Note: Please use the arrow keys or pageup/pagedown keys on your keyboard to switch slides.//''
! Year 2014
!! NGINX, Lua, and beyond
This talk was given at NGINX Inc's [[NGINX User Summit 2014|https://www.eventbrite.com/e/nginx-user-summit-and-training-tickets-10393173261]] on 25 February 2014.

View slides in your web browser: http://agentzh.org/misc/slides/nginx-user-summit-2014/

Download the slides as PDF: http://agentzh.org/misc/slides/nginx-lua-and-beyond.pdf

! Year 2013
!! The Way of Optimizing and Troubleshooting Our Lua Waf
This talk was given at ~CloudFlare's Beer Meeting on 19 April 2013.

View slides in your web browser: http://agentzh.org/misc/slides/beer-meeting-2013-04-19/

Download the slides as PDF: http://agentzh.org/misc/slides/beer-meeting-2013-04-19.pdf

!! sregex: matching Perl 5 regexes on data streams
This talk was given at [[YAPC::NA 2013|http://www.yapcna.org/yn2013/]] in Austin, TX, USA.

Talk summary: http://www.yapcna.org/yn2013/talk/4762

View slides in your web browser: http://agentzh.org/misc/slides/yapc-na-2013-sregex/

Download the slides as PDF: http://agentzh.org/misc/slides/yapc-na-2013-sregex.pdf

!! Flame Graphs for online performance profiling
This talk was given at [[YAPC::NA 2013|http://www.yapcna.org/yn2013/]] in Austin, TX, USA.

Talk summary: http://www.yapcna.org/yn2013/talk/4579

View slides in your web browser: http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs/

Download the slides as PDF: http://agentzh.org/misc/slides/yapc-na-2013-flame-graphs.pdf

!! Introduction to off-CPU Time Flame Graphs
This talk was given at the ~CloudFlare Beer Meeting on 23 August 2013.

View slides in your web browser: http://agentzh.org/misc/slides/off-cpu-flame-graphs/

Download the slides as PDF: http://agentzh.org/misc/slides/off-cpu-flame-graphs.pdf

! Year 2012
!! ngx_openresty: an Nginx ecosystem glued by Lua
This talk was given at [[Tech-Club Technical Salon|http://event.weibo.com/351359]] held in the Xiamen city.

View slides in your web browser: http://agentzh.org/misc/slides/ngx-openresty-ecosystem/

Download the slides as PDF: http://agentzh.org/misc/slides/ngx-openresty-ecosystem.pdf

!! Scripting libdrizzle with Lua inside Nginx
This presentation was given at [[Percona Live MySQL Conference 2012|http://www.percona.com/live/mysql-conference-2012/sessions/scripting-mysql-lua-and-libdrizzle-inside-nginx]] held in Santa Clara, CA, USA.

View slides in your web browser: http://agentzh.org/misc/slides/libdrizzle-lua-nginx/#2

Download the slides as PDF: http://agentzh.org/misc/slides/libdrizzle-lua-nginx.pdf

! Year 2011
!! Applications of ngx_openresty and perl in lz.taobao.com

This talk was given at [[Beijing Perl Workshop 2011|http://conference.perlchina.org/bjpw2011/talks]].

Watch the video online: http://v.ku6.com/show/TY8Vre59guTE_C8o.html

View slides in your web browser: http://agentzh.org/misc/slides/perl-lz-apps/

Download the slides as PDF: http://agentzh.org/misc/slides/perl-lz-apps.pdf

! Year 2010
!! Introduction to nginx.conf scripting
This talk was given at the [[Beijing Perl Workshop|http://conference.perlchina.org]] 2010 April meeting and the [[Beijing OpenParty 2010 June event|http://www.beijing-open-party.org/event/2]].

View slides in your web browser: http://agentzh.org/misc/slides/nginx-conf-scripting/

Download the slides as PDF: http://agentzh.org/misc/slides/nginx-conf-scripting.pdf

Please note that ngx_eval module is no longer recommended because we're in more favor of ngx_lua nowadays.

!! Recent developments in nginx.conf scripting
This talk was given at the [[Beijing OpenParty 2010 June event|http://www.beijing-open-party.org/event/2]].

View slides in your web browser: http://agentzh.org/misc/slides/recent-dev-nginx-conf/

Download the slides as PDF: http://agentzh.org/misc/slides/recent-dev-nginx-conf.pdf

!! The state of the art of nginx.conf scripting
This talk was given at the [[ECUG 2010 event|http://agentzh.org/misc/slides/nginx-state-of-the-art/]].

Watch the (Chinese-speech) video online: http://v.ku6.com/show/D00rqtnRwKzJdIsB.html

View the (English) slides in your web browser: http://agentzh.org/misc/slides/nginx-state-of-the-art/

Download the slides as PDF: http://agentzh.org/misc/slides/nginx-state-of-the-art.pdf
<<toolbar permalink>>

Profiling is important for analyzing and optimize OpenResty applications' performance.

We do provide various tools based on Systemtap for profiling live OpenResty applications both in production and development environments.

The most useful tools are
* C-land on-CPU Flame Graph tool: https://github.com/openresty/nginx-systemtap-toolkit#sample-bt
* C-land off-CPU Flame Graph tool: https://github.com/openresty/nginx-systemtap-toolkit#sample-bt-off-cpu
* Lua-land on-CPU Flame Graph tool: https://github.com/openresty/stapxx#lj-lua-stacks

It is recommended to build Systemtap from latest release source, see [[BuildSystemtap]] for details.

If you have problems in interpreting the resulting flame graphs or have troubles getting these tools running in your system, feel free to join our ~OpenResty [[Community]] and ask for help.
This is a standard Nginx module for talking to remote HTTP or HTTPS servers: http://wiki.nginx.org/HttpProxyModule
<<toolbar permalink>>

We run extensive regression testing for all our components (as well as other 3rd-party Nginx modules) on an Amazon ~EC2 cluster. The latest test report can always be viewed here:

http://qa.openresty.org/
<<toolbar permalink>>

This site's RSS  feed is available at http://openresty.org/index.xml [img[feed-icon-28x28.png]].
<<toolbar permalink>>

This Nginx module implements an efficient output filter that converts ~Resty-DBD-Streams (RDS) generated by DrizzleNginxModule and PostgresNginxModule to ~Comma-Separated Values (CSV) format in a streaming fashion.

By default, the CSV format is in compliance with RFC 4180:

        http://tools.ietf.org/html/rfc4180

This module is enabled by default in OpenResty. You can specify the {{{--without-http_rds_csv_module}}} option to disable this module while running {{{./configure}}} to build OpenResty.

Project homepage: https://github.com/agentzh/rds-csv-nginx-module
<<toolbar permalink>>

This is an output filter module that formats Resty DBD Streams (RDS) generated by ngx_drizzle and others to JSON streams.

Project page: http://github.com/agentzh/rds-json-nginx-module
<<toolbar permalink>>

This is an [[Nginx]] upstream module that makes nginx talk to a redis 2.x server in a non-blocking way. The full Redis 2.0 unified protocol has been implemented including the redis pipelining support.

This module returns the raw TCP response from the Redis server.

This module is enabled by default and can be disabled by passing the {{{--without-http_redis2_module}}} option to the {{{./configure}}} script for OpenResty.

Documentation wiki page: https://github.com/agentzh/redis2-nginx-module#readme

Project page: https://github.com/agentzh/redis2-nginx-module

When used in conjunction with [[LuaNginxModule]], it is recommended to use [[LuaRestyRedisLibrary]] module instead of this one, since it is more flexible and more memory-efficient.
<<toolbar permalink>>

This is an [[Nginx]] upstream module that makes nginx talk to a redis 2.x server in a non-blocking way. It has a similar interface with the standard [[ngx_memcached module|http://wiki.nginx.org/HttpMemcachedModule]], but only Redis {{{GET}}} and {{{SELECT}}} commands are supported.

This module returns the decoded result from the Redis server.

This module is written by Sergey A. Osokin.

This module is enabled by default and can be disabled by passing the {{{--without-http_redis_module}}} option to the {{{./configure}}} script for OpenResty.

Documentation wiki page: http://wiki.nginx.org/HttpRedisModule

When used in conjunction with [[LuaNginxModule]], it is recommended to use [[LuaRestyRedisLibrary]] instead of this one, since it is more flexible and more memory-efficient.

<<toolbar permalink>>
! English Articles
* Nginx image processing server with OpenResty and Lua, by leafo.
: http://leafo.net/posts/creating_an_image_server.html
* ~WebSockets with OpenResty, by Aapo Talvensaari.
: https://medium.com/p/1778601c9e05
* Scaling with Queues, by Rohit Yadav.
: http://engineering.wingify.com/scaling-with-queues/
* Scaling ~TextRazor in the Cloud with Nginx and Lua, by Toby.
: http://www.textrazor.com/blog/2013/03/scaling-textrazor-in-the-cloud-with-nginx-and-lua.html
* Augmenting ~APIs with Nginx and Lua, by Raimon Grau
: http://3scale.github.com/2013/01/09/augment-your-api-without-touching-it/
* Pushing Nginx to its limit with Lua, by Matthieu Tourne
: http://blog.cloudflare.com/pushing-nginx-to-its-limit-with-lua
* Yak Shaving: Adding ~OAuth Support to Nginx via Lua, by Jose ~Diaz-Gonzalez
: http://seatgeek.com/blog/dev/oauth-support-for-nginx-with-lua
* My beautiful dark twisted reverse-proxy LRU cache, by Mike Ferrier
: http://mikeferrier.com/2011/05/14/my-beautiful-dark-twisted-reverse-proxy-LRU-cache/
* Day 41 - Setting up ngx_openresty (WAS: testing Test::Nginx) , by Antoine Bonavita
: http://www.nginx-discovery.com/2011/03/day-41-setting-up-ngxopenresty-was.html
! Chinese Articles
* An introduction to OpenResty, by Wang Dong
: http://wdicc.com/intro-openresty/
* Nginx 3rd-Party Module Experiments Journal, by smallfish
: http://chenxiaoyu.org/2011/10/30/nginx-modules.html
* Recommending OpenResty - An Nginx Version with Fully Capable Addons, by Wendal Chen
: http://wendal.net/338.html
* Constructing Efficient and Transparent Caching Mechanism with MemcNginxModule and SrcacheNginxModule, by Zhang Yang
: http://www.codinglabs.org/html/nginx-memc-and-srcache.html
* The Nginx Session Module, by smallfish
: http://chenxiaoyu.org/2011/11/09/nginx-session.html
* ~Nginx-Lua HTTP 401 Basic Authentication, by smallfish
: http://chenxiaoyu.org/2012/02/08/nginx-lua-401-auth.html
* Using ngx_openresty to create an ~AJAX-style pager for data listing, by lhmwzy
: http://blog.163.com/lhmwzy@126/blog/static/64215736201212384413704/
* Nginx Variable Tutorials, by agentzh
: http://blog.sina.com.cn/openresty
* Nginx & Lua, by laowang
: http://huoding.com/2012/08/31/156
* Implementing a simple server-push solution, by laowang
: http://huoding.com/2012/09/28/174
<<toolbar permalink>>

This sample demonstrates how to route incoming requests to different ~MySQL queries based on different combinations of URI query arguments, preserving streaming output capabilities provided by DrizzleNginxModule and RdsJsonNginxModule.

This demo uses the modules DrizzleNginxModule, LuaNginxModule, RdsJsonNginxModule, and SetMiscNginxModule bundled by OpenResty.

Here's the complete code listing for our {{{nginx.conf}}}:

{{{
worker_processes  2;
error_log logs/error.log warn;

events {
    worker_connections 1024;
}

http {
    upstream backend {
        drizzle_server 127.0.0.1:3306 protocol=mysql
                       dbname=ngx_test user=ngx_test password=ngx_test;
        drizzle_keepalive max=10 overflow=ignore mode=single;
    }

    server {
        listen 8080;

        location @cats-by-name {
            set_unescape_uri $name $arg_name;
            set_quote_sql_str $name;
            drizzle_query 'select * from cats where name=$name';
            drizzle_pass backend;
            rds_json on;
        }

        location @cats-by-id {
            set_quote_sql_str $id $arg_id;
            drizzle_query 'select * from cats where id=$id';
            drizzle_pass backend;
            rds_json on;
        }

        location = /cats {
            access_by_lua '
                if ngx.var.arg_name then
                    return ngx.exec("@cats-by-name")
                end

                if ngx.var.arg_id then
                    return ngx.exec("@cats-by-id")
                end
            ';

            rds_json_ret 400 "expecting \"name\" or \"id\" query arguments";
        }
    }
}
}}}

And then we start our Nginx server with this configure file and test with our {{{/cats}}} service like this:
{{{
$ curl 'localhost:8080/cats'
{"errcode":400,"errstr":"expecting \"name\" or \"id\" query arguments"}

$ curl 'localhost:8080/cats?name=bob'
[{"id":3,"name":"bob"}]

$ curl 'localhost:8080/cats?id=2'
[{"id":2,"name":null}]
}}}
The actual output rows may vary depending on the actual contents in your {{{cats}}} table anyway.
<<toolbar permalink>>
* [[Routing requests to different MySQL queries based on URI arguments|RoutingMySQLQueriesBasedOnURIArgs]]
* [[Dynamic Request Routing Based on Redis|DynamicRoutingBasedOnRedis]]
* [[Using LuaRocks|UsingLuaRocks]]
<<toolbar permalink>>

This module adds various {{{set_xxx}}} directives added to [[Nginx]]'s [[rewrite module|http://wiki.nginx.org/NginxHttpRewriteModule]] (~MD5/~SHA1, SQL/JSON quoting, and many more).

Every directive provided by this module can be mixed freely with other nginx rewrite module's
  directives, like {{{if}}} and {{{set}}}.

Documentation: https://github.com/agentzh/set-misc-nginx-module#readme

Project page: http://github.com/agentzh/set-misc-nginx-module
a fast web app server by extending nginx 
OpenResty
<<toolbar permalink>>

This module provides a transparent caching layer for arbitrary nginx locations (like those use an upstream or even serve static disk files).

Usually, the MemcNginxModule is used together with this module to provide a concrete caching storage backend. But technically, any modules that provide a REST interface can be used as the fetching and storage subrequests used by this module.

Documentation page: https://github.com/agentzh/srcache-nginx-module#readme

Project page: http://github.com/agentzh/srcache-nginx-module
<<toolbar permalink>>

The standard Lua interpreter is enabled by default. If [[LuaJIT]] is enabled, this interpreter will be disabled automatically.

See Lua's homepage: http://www.lua.org/
body {
    font-size: 1.2em;
}
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:2.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:2.5em 0 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
<<toolbar permalink>>

You can upgrade OpenResty to a newer release in the exactly same way as upgrading Nginx.

You can override the existing installation tree but you still need to restart your running Nginx server from the new executable. Usually we do something like this:

http://wiki.nginx.org/CommandLine#Upgrading_To_a_New_Binary_On_The_Fly

You can also just stop your current Nginx server and start it from scratch again if you don't care about the down time in between.

But please note that HUP reload won't update the running Nginx server processes with the newly installed executable file.

If you are using shared memory storage in your Nginx server (like LuaNginxModule's shared memory dictionaries), then a full server restart will clear all the data in the shared memory zones. So be careful here.
<<toolbar permalink>>

//This module is now part of the official Nginx core.//

This is a keepalive balancer module for nginx that implements cache for backend connections.

Documentation: http://wiki.nginx.org/HttpUpstreamKeepaliveModule

Project page: http://mdounin.ru/hg/ngx_http_upstream_keepalive/
<<toolbar permalink>>

This sample demonstrates usage of [[LuaRocks|http://www.luarocks.org/]] with OpenResty. It's been tested on Linux and Mac OS X, with the standard Lua interpreter or with LuaJIT.

~LuaRocks is a deployment and management system for Lua modules. ~LuaRocks allows one to install Lua modules as self-contained packages called "rocks", which also contain version dependency  information.

We assume that you have installed OpenResty into the default location, i.e., {{{/usr/local/openresty}}}. You can adjust the paths in this sample according to the actual installation prefix of your OpenResty installation. If you haven't installed ~OpenResty yet, check out the [[Download]] and [[Installation]] pages.

! Install ~LuaRocks
First of all, let's install ~LuaRocks:

Download the ~LuaRocks tarball from [[http://www.luarocks.org/en/Download]]. As of this writing, the latest version is {{{2.1.2}}}, but we'll use {{{2.0.13}}} for compatibility throughout this sample.
{{{
wget http://luarocks.org/releases/luarocks-2.0.13.tar.gz
tar -xzvf luarocks-2.0.13.tar.gz
cd luarocks-2.0.13/
./configure --prefix=/usr/local/openresty/luajit \
    --with-lua=/usr/local/openresty/luajit/ \
    --lua-suffix=jit-2.1.0-alpha \
    --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make
sudo make install
}}}
! Install the Lua ~MD5 library with ~LuaRocks
In this sample, we'll use the Lua ~MD5 library to serve as an example, so let's install it with ~LuaRocks:
{{{
sudo /usr/local/openresty/luajit/luarocks install md5
}}}
! Configuring our ~OpenResty application
Let's change the current directory to {{{/usr/local/openresty/nginx/}}}:
{{{
cd /usr/local/openresty/nginx/
}}}
Next, edit the {{{conf/nginx.conf}}} file to the following contents with your favorite text editor (like vim or emacs):
{{{
worker_processes  1;   # we could enlarge this setting on a multi-core machine
error_log  logs/error.log warn;

events {
    worker_connections  1024;
}

http {
    lua_package_path 'conf/?.lua;;';

    server {
        listen       80;
        server_name  localhost;

        location = /luarocks {
            content_by_lua '
                local foo = require("foo")
                foo.say("hello, luarocks!")
            ';
        }
    }
}
}}}
Finally, create the following two Lua module files {{{conf/foo.lua}}}
{{{
-- conf/foo.lua

module("foo", package.seeall)

local bar = require "bar"

ngx.say("bar loaded")

function say (var)
    bar.say(var)
end
}}}
and {{{conf/bar.lua}}}
{{{
-- conf/bar.lua

module("bar", package.seeall)

local rocks = require "luarocks.loader"
local md5 = require "md5"

ngx.say("rocks and md5 loaded")

function say (a)
    ngx.say(md5.sumhexa(a))
end
}}}
! Start the Nginx server
Now we start the Nginx server with our app:
{{{
ulimit -n1024   # increase the maximal fd count limit per process
./sbin/nginx
}}}
If you have already started the Nginx server, then stop it before starting it:
{{{
./sbin/nginx -s stop
}}}
! Test our app
Now we can test our app via the {{{curl}}} utility or any HTTP compliant clients like a web browser:
{{{
curl http://localhost/luarocks
}}}
we could get the following outputs at the first run:
{{{
rocks and md5 loaded
bar loaded
85e73df5c41378f830c031b81e4453d2
}}}
then at the second run:
{{{
85e73df5c41378f830c031b81e4453d2
}}}
The output changed because LuaNginxModule by default caches already loaded Lua modules and those outputing code run at Lua module loading time will no longer be run.

Now let's do some benchmark:
{{{
ab -c10 -n50000 http://127.0.0.1/luarocks
}}}
On my Thinkpad T400 laptop (~Core2Duo T9600 CPU), it yields
{{{
Server Software:        ngx_openresty/1.0.4.2rc10
Server Hostname:        localhost
Server Port:            80

Document Path:          /luarocks
Document Length:        33 bytes

Concurrency Level:      10
Time taken for tests:   3.052 seconds
Complete requests:      50000
Failed requests:        0
Write errors:           0
Total transferred:      9400188 bytes
HTML transferred:       1650033 bytes
Requests per second:    16380.48 [#/sec] (mean)
Time per request:       0.610 [ms] (mean)
Time per request:       0.061 [ms] (mean, across all concurrent requests)
Transfer rate:          3007.41 [Kbytes/sec] received
}}}
Note that the throughput is achieved by a single nginx worker process. While doing such benchmark on your own, just be careful about error log level settings in your nginx.conf and not to run out of dynamic port range on your local machine, or it'll be significantly slow after a short of period of time.
! Known issues
Pior to OpenResty 1.0.4.2rc10, it's known that turning {{{lua_code_cache}}} on will cause ~LuaRocks atop LuaNginxModule to throw out the following exception in {{{error.log}}}:
{{{
lua handler aborted: runtime error: stack overflow
}}}
If you're using any version of OpenResty before 1.0.4.2rc10, please consider upgrading.
<<toolbar permalink>>

This module adds cross-site AJAX support to nginx. Currently only cross-site GET is supported.

The cross-site GET is currently implemented as JSONP (or "JSON with padding"). See http://en.wikipedia.org/wiki/JSON#JSONP for more details.

Project page: http://github.com/agentzh/xss-nginx-module
agentzh, 章亦春, the maintainer of this ~OpenResty bundle.

Homepage: http://agentzh.org
<<toolbar permalink>>

! eBook "agentzh's Nginx Tutorials" (version 2012.04.18)
* English Edition
** [[HTML Single-Page Format|http://openresty.org/download/agentzh-nginx-tutorials-enuk.html]] (Web browser users)
** [[MOBI Format|http://openresty.org/download/agentzh-nginx-tutorials-enuk.mobi]] (Kindle users)
** [[EPUB Format|http://openresty.org/download/agentzh-nginx-tutorials-enuk.epub]] (Sony, Apple and other users)
** [[PDF Format|http://openresty.org/download/agentzh-nginx-tutorials-enuk.pdf]] (PC users)
* Chinese Edition
** [[HTML Single-Page Format|http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html]] (Web browser users)
** [[MOBI Format|http://openresty.org/download/agentzh-nginx-tutorials-zhcn.mobi]] (Kindle users)
** [[EPUB Format|http://openresty.org/download/agentzh-nginx-tutorials-zhcn.epub]] (Sony, Apple and other users)
** [[PDF Format|http://openresty.org/download/agentzh-nginx-tutorials-zhcn.pdf]] (PC users)
* Git Repository
** https://github.com/agentzh/nginx-tutorials
<<toolbar permalink>>

This is the the client and protocol library for the Drizzle project. This library is now distributed with the Drizzle server release.

Project page: https://launchpad.net/drizzle