Skip to content

Commit 568f2ea

Browse files
committed
access_method & deny_method
0 parents  commit 568f2ea

File tree

5 files changed

+595
-0
lines changed

5 files changed

+595
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.cproject
2+
/.project
3+
/.settings

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (c) Zhang, Yuexiang (xfeep)
2+
All rights reserved.
3+
4+
The BSD 3-Clause License
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice, this
13+
list of conditions and the following disclaimer in the documentation and/or
14+
other materials provided with the distribution.
15+
16+
* Neither the name of Zhang, Yuexiang (xfeep) nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
24+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Nginx-Access-Plus
2+
=============
3+
4+
Nginx-Access-Plus is a [Nginx](http://nginx.org/) module allows limiting access to certain http request methods and client addresses.
5+
6+
7+
Installation
8+
=================
9+
10+
```shell
11+
#If nginx source is checked out from hg, please replace ./configure with auto/configure
12+
$./configure \
13+
--add-module=nginx-access-plus/src/c
14+
$ make
15+
$ make install
16+
```
17+
18+
19+
User Guide
20+
=================
21+
22+
Only Allow GET and HEAD Method
23+
-----------------
24+
25+
```nginx
26+
location / {
27+
allow_method all get|head;
28+
deny_method all all;
29+
}
30+
```
31+
32+
All GET and HEAD Method But Deny All POST|DELETE Requests Except for 192.168.1.*
33+
-----------------
34+
35+
```nginx
36+
location / {
37+
allow_method all get|head;
38+
allow_method 192.168.1.0/24 post|delete;
39+
deny_method all all;
40+
}
41+
```
42+
43+
Deny POST|PUT|DELETE Requests from 192.168.1.*
44+
-----------------
45+
46+
```nginx
47+
location / {
48+
deny_method 192.168.1.0/24 post|put|delete;
49+
}
50+
```
51+
52+
License
53+
=================
54+
Copyright © 2015 Zhang, Yuexiang (xfeep) and released under the BSD 3-Clause license.
55+

src/c/config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ngx_addon_name=ngx_http_access_plus_module
2+
HTTP_MODULES="$HTTP_MODULES ngx_http_access_plus_module"
3+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
4+
$ngx_addon_dir/ngx_http_access_plus_module.c \
5+
"

0 commit comments

Comments
 (0)