[mod] added upstream port customization
This commit is contained in:
@@ -138,6 +138,10 @@ function gen_server_config()
|
||||
local domain_count=0
|
||||
local domains="$root_domain"
|
||||
|
||||
# default to 8080 if server port is undefined
|
||||
local port=":8080";
|
||||
[[ $server == *":"* ]] && port=""
|
||||
|
||||
# no arrays in dash
|
||||
local subdomain=$(get_element $domain_count " " $domain_list)
|
||||
while [ ${#subdomain} -gt 0 ]; do
|
||||
@@ -167,7 +171,7 @@ function gen_server_config()
|
||||
# allow for upstream to be offline by setting
|
||||
# docker dns resolver and a variable for the server
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
proxy_pass http://\$upstream:8080;
|
||||
proxy_pass http://\$upstream$port;
|
||||
|
||||
proxy_redirect off;
|
||||
proxy_set_header Host \$host;
|
||||
@@ -299,4 +303,4 @@ function main()
|
||||
nginx_handler
|
||||
}
|
||||
|
||||
main $@
|
||||
main $@
|
||||
|
||||
Reference in New Issue
Block a user