You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
533 B
25 lines
533 B
worker_processes 1;
|
|
error_log logs/error.log;
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
http {
|
|
server {
|
|
listen 8080;
|
|
set $target '';
|
|
location / {
|
|
access_by_lua '
|
|
local t = io.popen("/app/checkPort")
|
|
local a = t:read("*all")
|
|
|
|
if( string.gsub(a,"%D","") == "0" )
|
|
then
|
|
ngx.var.target="http://127.0.0.1:5000"
|
|
else
|
|
ngx.var.target="http://127.0.0.1:2233"
|
|
end
|
|
';
|
|
proxy_pass $target;
|
|
}
|
|
}
|
|
} |