47 lines
1.5 KiB
Plaintext
47 lines
1.5 KiB
Plaintext
server {
|
|
server_name *.hns.${PORTAL_DOMAIN}; # example: *.hns.siasky.net
|
|
|
|
include /etc/nginx/conf.d/server/server.http;
|
|
}
|
|
|
|
server {
|
|
server_name *.hns.${PORTAL_DOMAIN}; # example: *.hns.siasky.net
|
|
|
|
set_by_lua_block $skynet_portal_domain { return "${PORTAL_DOMAIN}" }
|
|
set_by_lua_block $skynet_server_domain {
|
|
-- fall back to portal domain if server domain is not defined
|
|
if "${SERVER_DOMAIN}" == "" then
|
|
return "${PORTAL_DOMAIN}"
|
|
end
|
|
return "${SERVER_DOMAIN}"
|
|
}
|
|
|
|
proxy_set_header Host ${PORTAL_DOMAIN};
|
|
include /etc/nginx/conf.d/server/server.hns;
|
|
}
|
|
|
|
server {
|
|
server_name *.hns.${SERVER_DOMAIN}; # example: *.hns.eu-ger-1.siasky.net
|
|
|
|
include /etc/nginx/conf.d/server/server.http;
|
|
|
|
set_by_lua_block $server_alias { return string.match("${SERVER_DOMAIN}", "^([^.]+)") }
|
|
}
|
|
|
|
server {
|
|
server_name *.hns.${SERVER_DOMAIN}; # example: *.hns.eu-ger-1.siasky.net
|
|
|
|
set_by_lua_block $skynet_portal_domain {
|
|
-- when accessing portal directly through server domain, portal domain should be set to server domain
|
|
-- motivation: skynet-js uses Skynet-Portal-Api header (that is set to $skynet_portal_domain) to detect current
|
|
-- portal address and it should be server domain when accessing specific server by its domain address
|
|
return "${SERVER_DOMAIN}"
|
|
}
|
|
set_by_lua_block $skynet_server_domain { return "${SERVER_DOMAIN}" }
|
|
|
|
proxy_set_header Host ${SERVER_DOMAIN};
|
|
include /etc/nginx/conf.d/server/server.hns;
|
|
|
|
set_by_lua_block $server_alias { return string.match("${SERVER_DOMAIN}", "^([^.]+)") }
|
|
}
|