Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 20c348b

Browse files
authored
Merge pull request #25 from SkynetLabs/karol/sky-1322-skylinksdomaintld-does-not-show-custom
custom 401 for subdomain hns and skylink endpoints
2 parents efc2913 + d1d132d commit 20c348b

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

nginx/conf.d/include/error-pages

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error_page 401 /401.html;
2+
location = /401.html {
3+
root /etc/nginx/conf.d/pages;
4+
internal;
5+
}

nginx/conf.d/server/server.api

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ listen 443 ssl http2;
22

33
include /etc/nginx/conf.d/include/ssl-settings;
44
include /etc/nginx/conf.d/include/init-optional-variables;
5+
include /etc/nginx/conf.d/include/error-pages;
56

67
# ddos protection: closing slow connections
78
client_body_timeout 1h;
@@ -23,12 +24,6 @@ rewrite ^/stats /skynet/stats permanent;
2324
rewrite ^/skynet/blacklist /skynet/blocklist permanent;
2425
rewrite ^/docs(?:/(.*))?$ https://sdk.skynetlabs.com/$1 permanent;
2526

26-
error_page 401 /401.html;
27-
location = /401.html {
28-
root /etc/nginx/conf.d/pages;
29-
internal;
30-
}
31-
3227
location / {
3328
include /etc/nginx/conf.d/include/cors;
3429

nginx/conf.d/server/server.hns

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ listen 443 ssl http2;
22

33
include /etc/nginx/conf.d/include/ssl-settings;
44
include /etc/nginx/conf.d/include/init-optional-variables;
5+
include /etc/nginx/conf.d/include/error-pages;
56

67
location / {
78
set_by_lua_block $hns_domain { return string.match(ngx.var.host, "[^%.]+") }

nginx/conf.d/server/server.skylink

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ listen 443 ssl http2;
22

33
include /etc/nginx/conf.d/include/ssl-settings;
44
include /etc/nginx/conf.d/include/init-optional-variables;
5+
include /etc/nginx/conf.d/include/error-pages;
56

67
location / {
78
set_by_lua_block $skylink { return string.match(ngx.var.host, "%w+") }

0 commit comments

Comments
 (0)