mirror of
https://github.com/NginxProxyManager/docker-nginx-full.git
synced 2026-06-17 07:44:33 +00:00
Downgrade to lua 5.1.5. ngx_http_lua_module only works with 5.1 Re-add install lua-resty-http module Adds simple test suite for http module
36 lines
638 B
Plaintext
36 lines
638 B
Plaintext
server {
|
|
listen 8080;
|
|
listen [::]:8080;
|
|
|
|
server_name localhost;
|
|
|
|
location /lua {
|
|
default_type application/json;
|
|
|
|
content_by_lua_block {
|
|
local http = require("resty.http")
|
|
|
|
local httpc = http.new()
|
|
httpc:set_timeout(5000)
|
|
|
|
local res, err = httpc:request_uri("http://127.0.0.1:8080/", {
|
|
method = "GET"
|
|
})
|
|
|
|
if not res then
|
|
ngx.status = 500
|
|
ngx.say('{"ok":false,"error":"' .. (err or "unknown") .. '"}')
|
|
return
|
|
end
|
|
|
|
ngx.status = 200
|
|
ngx.say('{"ok":true,"status":' .. res.status .. ',"body":"' .. (res.body or "") .. '"}')
|
|
}
|
|
}
|
|
|
|
location / {
|
|
index index.html;
|
|
root /var/www/html;
|
|
}
|
|
}
|