2021-08-27 12:15:22 +00:00
|
|
|
{{#PORTAL_DOMAIN}}
|
|
|
|
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
|
|
|
|
|
2022-02-25 14:24:09 +00:00
|
|
|
set_by_lua_block $skynet_portal_domain { return "{{PORTAL_DOMAIN}}" }
|
2022-02-28 14:11:11 +00:00
|
|
|
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}}"
|
|
|
|
}
|
2022-02-25 14:24:09 +00:00
|
|
|
|
2021-08-27 12:15:22 +00:00
|
|
|
ssl_certificate /data/caddy/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.hns.{{PORTAL_DOMAIN}}/wildcard_.hns.{{PORTAL_DOMAIN}}.crt;
|
|
|
|
ssl_certificate_key /data/caddy/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.hns.{{PORTAL_DOMAIN}}/wildcard_.hns.{{PORTAL_DOMAIN}}.key;
|
|
|
|
|
|
|
|
proxy_set_header Host {{PORTAL_DOMAIN}};
|
|
|
|
include /etc/nginx/conf.d/server/server.hns;
|
|
|
|
}
|
|
|
|
{{/PORTAL_DOMAIN}}
|
|
|
|
|
|
|
|
{{#SERVER_DOMAIN}}
|
|
|
|
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
|
|
|
|
|
|
|
|
ssl_certificate /data/caddy/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.hns.{{SERVER_DOMAIN}}/wildcard_.hns.{{SERVER_DOMAIN}}.crt;
|
|
|
|
ssl_certificate_key /data/caddy/caddy/certificates/acme-v02.api.letsencrypt.org-directory/wildcard_.hns.{{SERVER_DOMAIN}}/wildcard_.hns.{{SERVER_DOMAIN}}.key;
|
2022-02-25 14:24:09 +00:00
|
|
|
|
|
|
|
set_by_lua_block $skynet_portal_domain { return "{{SERVER_DOMAIN}}" }
|
|
|
|
set_by_lua_block $skynet_server_domain { return "{{SERVER_DOMAIN}}" }
|
2021-08-27 12:15:22 +00:00
|
|
|
|
|
|
|
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}}", "^([^.]+)") }
|
|
|
|
}
|
|
|
|
{{/SERVER_DOMAIN}}
|