From 35bf172d28c4de0720dc96474e6bfa0eb702364b Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 20 May 2022 12:37:41 +0200 Subject: [PATCH] use static html error page --- docker-compose.yml | 3 +- docker/nginx/conf.d/include/location-skylink | 12 +-- .../nginx/templates/pages/401.html.template | 89 +++++++++++++++++++ .../server.account.conf.template | 0 .../server.api.conf.template | 0 .../server.dnslink.conf.template | 0 .../server.hns.conf.template | 0 .../server.skylink.conf.template | 0 8 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 docker/nginx/templates/pages/401.html.template rename docker/nginx/{conf.d.templates => templates}/server.account.conf.template (100%) rename docker/nginx/{conf.d.templates => templates}/server.api.conf.template (100%) rename docker/nginx/{conf.d.templates => templates}/server.dnslink.conf.template (100%) rename docker/nginx/{conf.d.templates => templates}/server.hns.conf.template (100%) rename docker/nginx/{conf.d.templates => templates}/server.skylink.conf.template (100%) diff --git a/docker-compose.yml b/docker-compose.yml index 998eb8f6..f9a3630d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,9 +74,8 @@ services: - ./docker/data/certbot:/etc/letsencrypt - ./docker/nginx/libs:/etc/nginx/libs - ./docker/nginx/conf.d:/etc/nginx/conf.d - - ./docker/nginx/conf.d.templates:/etc/nginx/templates + - ./docker/nginx/templates:/etc/nginx/templates - ./docker/nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf - - ./docker/data/website/public:/etc/nginx/public networks: shared: ipv4_address: 10.10.10.30 diff --git a/docker/nginx/conf.d/include/location-skylink b/docker/nginx/conf.d/include/location-skylink index 1ef2482b..1509eb7b 100644 --- a/docker/nginx/conf.d/include/location-skylink +++ b/docker/nginx/conf.d/include/location-skylink @@ -38,12 +38,12 @@ proxy_set_header User-Agent: Sia-Agent; proxy_pass http://sia:9980/skynet/skylink/$skylink$path$is_args$args; proxy_intercept_errors on; -error_page 400 /etc/nginx/public/errors/400/index.html; -error_page 401 /etc/nginx/public/errors/401/index.html; -error_page 403 /etc/nginx/public/errors/403/index.html; -error_page 404 /etc/nginx/public/errors/404/index.html; -error_page 451 /etc/nginx/public/errors/451/index.html; -error_page 500 /etc/nginx/public/errors/500/index.html; +# error_page 400 /etc/nginx/public/etc/nginx/conf.d/pages/400.html; +error_page 401 /etc/nginx/public/etc/nginx/conf.d/pages/401.html; +# error_page 403 /etc/nginx/public/etc/nginx/conf.d/pages/403.html; +# error_page 404 /etc/nginx/public/etc/nginx/conf.d/pages/404.html; +# error_page 451 /etc/nginx/public/etc/nginx/conf.d/pages/451.html; +# error_page 500 501 502 503 /etc/nginx/public/etc/nginx/conf.d/pages/5xx.html; log_by_lua_block { local skynet_account = require("skynet.account") diff --git a/docker/nginx/templates/pages/401.html.template b/docker/nginx/templates/pages/401.html.template new file mode 100644 index 00000000..0a5af747 --- /dev/null +++ b/docker/nginx/templates/pages/401.html.template @@ -0,0 +1,89 @@ + + + + + + + 401: Unauthorized + + + + + + + + + + + + + +
+
+
+ + Skynet + + +
+
+

+ You must be authenticated to access this content +

+

+ You're being redirected to the Log In page of this Skynet Portal +

+

HTTP 401: Unauthorized

+
+
+

+ If you're not redirected automatically, + click here. +

+
+
+
+
+
+ + + diff --git a/docker/nginx/conf.d.templates/server.account.conf.template b/docker/nginx/templates/server.account.conf.template similarity index 100% rename from docker/nginx/conf.d.templates/server.account.conf.template rename to docker/nginx/templates/server.account.conf.template diff --git a/docker/nginx/conf.d.templates/server.api.conf.template b/docker/nginx/templates/server.api.conf.template similarity index 100% rename from docker/nginx/conf.d.templates/server.api.conf.template rename to docker/nginx/templates/server.api.conf.template diff --git a/docker/nginx/conf.d.templates/server.dnslink.conf.template b/docker/nginx/templates/server.dnslink.conf.template similarity index 100% rename from docker/nginx/conf.d.templates/server.dnslink.conf.template rename to docker/nginx/templates/server.dnslink.conf.template diff --git a/docker/nginx/conf.d.templates/server.hns.conf.template b/docker/nginx/templates/server.hns.conf.template similarity index 100% rename from docker/nginx/conf.d.templates/server.hns.conf.template rename to docker/nginx/templates/server.hns.conf.template diff --git a/docker/nginx/conf.d.templates/server.skylink.conf.template b/docker/nginx/templates/server.skylink.conf.template similarity index 100% rename from docker/nginx/conf.d.templates/server.skylink.conf.template rename to docker/nginx/templates/server.skylink.conf.template