yaoweibin/nginx_session_store_module
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Name nginx_session_store_module - support session with Nginx Status This module is at its very early phase of development and considered highly experimental. But you're encouraged to test it out on your side and report any quirks that you experience. We need your help! If you find this module useful and/or interesting, please consider joining the development! Synopsis http { server { listen 80; server_name localhost; session_zone $binary_remote_addr zone=test:10M; location / { set $t1 yaoweibin; set $t2 yaoweibin2; rewrite (.*) /store last; return 404; } location /store { session_store zone=test $t1 $t2; #store $t1, $t2 successfully, do whatever else; } location /get { session_get zone=test $tt1 $tt2; #any handler with $tt1 and $tt2; } } } Description Add the support of session with Nginx, the session's lifetime is long than the request or connection. Directives session_zone syntax: *session_zone $session_variable zone=name_of_zone:size* default: *none* context: *http, server* description: The directive describes the area, which stores the information with the sessions. The values of the session is determined by the given variable. Example of usage: session_zone $binary_remote_addr zone=test:10m; In this case, the session share memory zone is allocated 10MB as a zone called "test". session_store syntax: *session_store zone=name_of_zone [exprie=time_of_exprie] $variable1 [$variable2 ... $variable8]* default: *none* context: *location* description: Store the $variable1 to $variableN to the zone with the key of zone's session variable. The maximum number of variables is 8. Be careful, this directive executes before the 'set' and 'rewrite' directives. The expire is the timeout of the session. After the expired time, the session will be deleted. Default value is 60 seconds. session_get syntax: *session_get zone=name_of_zone $variable1 [$variable2 ... $variable8]* default: *none* context: *location* description: Get the $variable1 to $variableN from the zone with the key of zone's session variable. The maximum number of variables is 8. Be careful, this directive executes before the 'set' and 'rewrite' directives. Installation Download the latest version of the release tarball of this module from github (<http://github.com/yaoweibin/nginx_session_store_module>) Grab the nginx source code from nginx.org (<http://nginx.org/>), for example, the version 0.7.67 (see nginx compatibility), and then build the source with this module: $ wget 'http://nginx.org/download/nginx-0.7.67.tar.gz' $ tar -xzvf nginx-0.7.67.tar.gz $ cd nginx-0.7.67/ $ ./configure --add-module=/path/to/nginx_session_store_module $ make $ make install Compatibility * My test bed is 0.7.67 and 0.8.50. TODO Known Issues * Developing Changelogs v0.1 * first release Authors Weibin Yao(姚伟斌) *yaoweibin at gmail dot com* Copyright & License This README template copy from agentzh (<http://github.com/agentzh>). This module is licensed under the BSD license. Copyright (C) 2010 by Weibin Yao <yaoweibin@gmail.com>. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
About
add the session support for Nginx
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published