Skip to content

Commit 1f78330

Browse files
committed
first commit
0 parents  commit 1f78330

File tree

7 files changed

+808
-0
lines changed

7 files changed

+808
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
work/
2+
buildroot/
3+
t/servroot/

README.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Name
2+
====
3+
4+
**ngx_base64** - Nginx HTTP Base64 Filter Module.
5+
6+
*This module is not distributed with the Nginx source.* See [the installation instructions](#installation).
7+
8+
Table of Contents
9+
=================
10+
11+
* [Name](#name)
12+
* [Status](#status)
13+
* [Synopsis](#synopsis)
14+
* [Description](#description)
15+
* [Directives](#directives)
16+
* [base64](#base64)
17+
* [base64_max_length](#base64_max_length)
18+
* [Installation](#installation)
19+
* [Author](#author)
20+
* [Copyright and License](#copyright-and-license)
21+
* [See Also](#see-also)
22+
23+
Status
24+
======
25+
26+
This module is already quite usable though still at the early phase of development
27+
and is considered experimental.
28+
29+
Synopsis
30+
========
31+
32+
```nginx
33+
location = /t {
34+
base64 on;
35+
base64_max_length 10485760;
36+
37+
echo "hello world";
38+
}
39+
```
40+
41+
Description
42+
===========
43+
44+
This module allows for on-the-fly base64 encode. As same as the standard [ngx_http_gzip_module](http://nginx.org/en/docs/http/ngx_http_gzip_module.html).
45+
46+
[Back to TOC](#table-of-contents)
47+
48+
Directives
49+
==========
50+
51+
[Back to TOC](#table-of-contents)
52+
53+
base64
54+
--------------
55+
**syntax:** *base64 on | off*
56+
57+
**default:** *off*
58+
59+
**context:** *http, server, location, location if*
60+
61+
Enables or disables base64 encode.
62+
63+
base64_max_length
64+
--------------
65+
**syntax:** *base64 <length>*
66+
67+
**default:** *1048576 (1MB)*
68+
69+
**context:** *http, server, location*
70+
71+
Sets the maximum length, in bytes, of the response that will be encode. Responses larger than this byte-length will not be encode. Length is determined from the "Content-Length" header.
72+
73+
[Back to TOC](#table-of-contents)
74+
75+
Installation
76+
============
77+
78+
Grab the nginx source code from [nginx.org](http://nginx.org/), for example,
79+
the version 1.7.0, and then build the source with this module:
80+
81+
```bash
82+
83+
$ wget 'http://nginx.org/download/nginx-1.7.0.tar.gz'
84+
$ tar -xzvf nginx-1.7.0.tar.gz
85+
$ cd nginx-1.7.0/
86+
87+
# Here we assume you would install you nginx under /opt/nginx/.
88+
$ ./configure --prefix=/opt/nginx \
89+
--add-module=/path/to/base64-nginx-module
90+
91+
$ make -j2
92+
$ make install
93+
```
94+
95+
[Back to TOC](#table-of-contents)
96+
97+
Author
98+
======
99+
100+
Monkey Zhang (timebug) <timebug.info@gmail.com>, UPYUN Inc.
101+
102+
[Back to TOC](#table-of-contents)
103+
104+
Copyright and License
105+
=====================
106+
107+
This module is licensed under the BSD license.
108+
109+
Copyright (C) 2014, by Monkey Zhang (timebug), UPYUN Inc.
110+
111+
All rights reserved.
112+
113+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
114+
115+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
116+
117+
* 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.
118+
119+
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.
120+
121+
[Back to TOC](#table-of-contents)

config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ngx_addon_name=ngx_http_base64_filter_module
2+
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_base64_filter_module"
3+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_base64_filter_module.c"

0 commit comments

Comments
 (0)