mirror of
https://github.com/lucky-sideburn/kubeinvaders.git
synced 2026-04-19 08:26:54 +00:00
38 lines
1.0 KiB
Plaintext
38 lines
1.0 KiB
Plaintext
server {
|
|
listen 8080 default_server;
|
|
root /var/www/html/;
|
|
index index.html;
|
|
|
|
location /kube/kube-linter {
|
|
default_type text/html;
|
|
content_by_lua_block {
|
|
local arg = ngx.req.get_uri_args()
|
|
ngx.req.read_body()
|
|
local request_body = ngx.req.get_body_data()
|
|
local handle = io.popen("/opt/kube-linter-parser.sh " .. arg['k8s_url'] .. " " .. arg['namespace'] .. " " .. arg['pod_name'] .. " " .. arg['token'])
|
|
local result = handle:read("*a")
|
|
ngx.say(result)
|
|
}
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
add_header Last-Modified $date_gmt;
|
|
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
if_modified_since off;
|
|
expires off;
|
|
etag off;
|
|
}
|
|
|
|
location /kube {
|
|
rewrite ^/kube(.*)$ /api$1 break;
|
|
proxy_pass https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS};
|
|
}
|
|
|
|
location /kube/api {
|
|
rewrite ^/kube/api(.*)$ /api$1 break;
|
|
proxy_pass https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS};
|
|
}
|
|
|
|
}
|