swarm/k8s - less storage, more API

This commit is contained in:
florian
2021-09-05 00:36:15 +02:00
parent 062fa3e78a
commit ca81535bb3
18 changed files with 133 additions and 47 deletions

View File

@@ -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 {
}
}

View File

@@ -1,4 +1,5 @@
# todo : if api_uri == "random"
client_max_body_size 1G;
rewrite_by_lua_block {
local api = require "api"

View File

@@ -1,6 +1,6 @@
load_module /usr/lib/nginx/modules/ngx_http_lua_module.so;
daemon on;
#daemon on;
pid /tmp/nginx-temp.pid;