swarm/k8s - less storage, more API
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
location ~ ^%API_URI%/ping {
|
||||
return 444;
|
||||
}
|
||||
client_max_body_size 1G;
|
||||
|
||||
location ~ %API_URI% {
|
||||
|
||||
@@ -15,10 +13,10 @@ rewrite_by_lua_block {
|
||||
ngx.header.content_type = 'text/plain'
|
||||
if api.do_api_call(api_uri) then
|
||||
logger.log(ngx.NOTICE, "API", "API call " .. ngx.var.request_uri .. " successfull from " .. ngx.var.remote_addr)
|
||||
ngx.say("ok")
|
||||
ngx.print("ok")
|
||||
else
|
||||
logger.log(ngx.WARN, "API", "API call " .. ngx.var.request_uri .. " failed from " .. ngx.var.remote_addr)
|
||||
ngx.say("ko")
|
||||
ngx.print("ko")
|
||||
end
|
||||
|
||||
ngx.exit(ngx.HTTP_OK)
|
||||
@@ -29,3 +27,4 @@ rewrite_by_lua_block {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# todo : if api_uri == "random"
|
||||
client_max_body_size 1G;
|
||||
rewrite_by_lua_block {
|
||||
|
||||
local api = require "api"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;
|
||||
|
||||
daemon on;
|
||||
#daemon on;
|
||||
|
||||
pid /tmp/nginx-temp.pid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user