-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
Description
This is my test code, check_http_send is a directive of popular nginx module nginx_upstream_check_module
import nginx
UPSTREAM_BLOCK = """
upstream test0 {
server 1.1.1.1:8080;
check interval=3000 rise=2 fall=3 timeout=3000 type=http;
check_http_send "GET /alive.html HTTP/1.0\r\n\r\n";
check_http_expect_alive http_2xx http_3xx;
}
upstream test1 {
ip_hash;
server 2.2.2.2:9000;
check_http_send 'GET /alive.html HTTP/1.0\r\n\r\n';
}
"""
data = nginx.loads(UPSTREAM_BLOCK)
print nginx.dumps(data)and I got this output:
upstream test0 {
server 1.1.1.1:8080;
check interval=3000 rise=2 fall=3 timeout=3000 type=http;
check_http_send GET /alive.html HTTP/1.0
;
check_http_expect_alive http_2xx http_3xx;
}
upstream test1 {
None;
}
There are 2 bugs here:
- Lost double quote in
check_http_sendline of upstreamtest0. - The upstream
tets1is freaky.
This is a awesome project. It will be glade to see you fix this.