started work on moving variables from .lua to nginx
This commit is contained in:
@@ -7,10 +7,11 @@ location ~ ^%API_URI% {
|
||||
|
||||
rewrite_by_lua_block {
|
||||
|
||||
local api = require "api"
|
||||
local api_uri = "%API_URI%"
|
||||
local api = require "api"
|
||||
local api_whitelist_ip = {%API_WHITELIST_IP%}
|
||||
local api_uri = "%API_URI%"
|
||||
|
||||
if api.is_api_call(api_uri) then
|
||||
if api.is_api_call(api_uri, api_whitelist_ip) then
|
||||
ngx.header.content_type = 'text/plain'
|
||||
if api.do_api_call(api_uri) then
|
||||
ngx.log(ngx.NOTICE, "[API] API call " .. ngx.var.request_uri .. " successfull from " .. ngx.var.remote_addr)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
rewrite_by_lua_block {
|
||||
|
||||
local api = require "api"
|
||||
local api_uri = "%API_URI%"
|
||||
local api = require "api"
|
||||
local api_whitelist_ip = {%API_WHITELIST_IP%}
|
||||
local api_uri = "%API_URI%"
|
||||
|
||||
if api.is_api_call(api_uri) then
|
||||
if api.is_api_call(api_uri, api_whitelist_ip) then
|
||||
ngx.header.content_type = 'text/plain'
|
||||
if api.do_api_call(api_uri) then
|
||||
ngx.log(ngx.NOTICE, "[API] API call " .. ngx.var.request_uri .. " successfull from " .. ngx.var.remote_addr)
|
||||
|
||||
Reference in New Issue
Block a user