From bd6763b47c6609d8adaf8d7df476cd32a751100a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Wypch=C5=82o?= Date: Tue, 11 May 2021 18:32:02 +0200 Subject: [PATCH] disable api access from subdomained skapps (#719) * disable api access from subdomained skapps * temporary reroute from skynet-mysky to ann1 dev version * revert dev change * mistakenly deleted try --- docker/nginx/conf.d/client.conf | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 0a2c4f26..63c92812 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -72,23 +72,23 @@ server { rewrite ^/skynet/blacklist /skynet/blocklist permanent; rewrite ^/account/(.*) https://account.$domain.$tld/$1 permanent; + # This is only safe workaround to reroute based on some conditions + # See https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ + recursive_error_pages on; + + # redirect links with base32 encoded skylink in subdomain + error_page 460 = @base32_subdomain; + if ($base32_subdomain != "") { + return 460; + } + + # redirect links with handshake domain on hns subdomain + error_page 461 = @hns_domain; + if ($hns_domain != "") { + return 461; + } + location / { - # This is only safe workaround to reroute based on some conditions - # See https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ - recursive_error_pages on; - - # redirect links with base32 encoded skylink in subdomain - error_page 460 = @base32_subdomain; - if ($base32_subdomain != "") { - return 460; - } - - # redirect links with handshake domain on hns subdomain - error_page 461 = @hns_domain; - if ($hns_domain != "") { - return 461; - } - include /etc/nginx/conf.d/include/cors; proxy_pass http://website:9000;