Skip to content

Commit 55d0433

Browse files
committed
0 parents  commit 55d0433

File tree

5 files changed

+693
-0
lines changed

5 files changed

+693
-0
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Initial check in, forked from https://github.com/alibaba/tengine

LICENSE

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (C) 2002-2013 Igor Sysoev
3+
* Copyright (C) 2011,2013 Nginx, Inc.
4+
* Copyright (C) 2010-2015 Alibaba Group Holding Limited
5+
* Copyright (C) 2011-2013 Xiaozhe "chaoslawful" Wang
6+
* Copyright (C) 2011-2013 Zhang "agentzh" Yichun
7+
* Copyright (C) 2011-2013 Weibin Yao
8+
* Copyright (C) 2012-2013 Sogou, Inc.
9+
* Copyright (C) 2012-2013 NetEase, Inc.
10+
* All rights reserved.
11+
*
12+
* Redistribution and use in source and binary forms, with or without
13+
* modification, are permitted provided that the following conditions
14+
* are met:
15+
* 1. Redistributions of source code must retain the above copyright
16+
* notice, this list of conditions and the following disclaimer.
17+
* 2. Redistributions in binary form must reproduce the above copyright
18+
* notice, this list of conditions and the following disclaimer in the
19+
* documentation and/or other materials provided with the distribution.
20+
*
21+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31+
* SUCH DAMAGE.
32+
*/

README

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Name
2+
ngx_http_upstream_dynamic_module
3+
This module provides the functionality to resolve domain names into IP addresses in an upstream at run-time.
4+
It comes from Taobao Tengine @ http://tengine.taobao.org
5+
6+
Synopsis
7+
8+
upstream backend {
9+
dynamic_resolve fallback=stale fail_timeout=30s;
10+
11+
server a.com;
12+
server b.com;
13+
}
14+
15+
server {
16+
...
17+
18+
location / {
19+
proxy_pass http://backend;
20+
}
21+
}
22+
23+
Notes
24+
25+
It is a tengine module from
26+
https://github.com/alibaba/tengine/blob/master/src/http/modules/ngx_http_upstream_dynamic_module.c
27+
and made to work with nginx 1.9
28+
It follows original tengine license.

ngx_http_upstream_dynamic.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Name
2+
====
3+
4+
* ngx_http_upstream_dynamic_module
5+
6+
Description
7+
===========
8+
9+
* This module provides the functionality to resolve domain names into IP addresses in an upstream at run-time.
10+
11+
Examples
12+
========
13+
14+
upstream backend {
15+
dynamic_resolve fallback=stale fail_timeout=30s;
16+
17+
server a.com;
18+
server b.com;
19+
}
20+
21+
server {
22+
...
23+
24+
proxy_pass http://backend;
25+
}
26+
27+
Directives
28+
==========
29+
30+
dynamic_resolve
31+
---------------
32+
33+
**Syntax**: *dynamic_resolve [fallback=stale|next|shutdown] [fail_timeout=time]*
34+
35+
**Default**: *-*
36+
37+
**Context**: *upstream*
38+
39+
Enable dynamic DNS resolving functionality in an upstream.
40+
41+
The 'fallback' parameter specifies what action to take if a domain name can not be resolved into an IP address:
42+
43+
* stale, use the original IP addresses resolved when tengine starts.
44+
* next, go to next availiable server in the upstream.
45+
* shutdown, finalize current request.
46+
47+
The 'fail_timeout' parameter specifies how long time tengine considers the DNS server as unavailiable if a DNS query fails for a server in the upstream. In this period of time, all requests comming will follow what 'fallback' specifies.

0 commit comments

Comments
 (0)