add /blacklist endpoint

This commit is contained in:
Karol Wypchlo 2020-06-23 18:20:59 +02:00
parent 82328942cb
commit ef7afd4c4e
2 changed files with 21 additions and 1 deletions

View File

@ -15,6 +15,16 @@
method OPTIONS
}
@blacklist {
method GET
path /blacklist
}
@portals {
method GET
path /portals
}
# OPTIONS headers to allow CORS https://enable-cors.org
handle @options {
header {
@ -28,7 +38,11 @@
reverse_proxy /health-check health-check:3100
reverse_proxy /portals nginx:80 {
reverse_proxy @blacklist nginx:80 {
header_up User-Agent Sia-Agent
header_down Access-Control-Allow-Origin *
}
reverse_proxy @portals nginx:80 {
header_up User-Agent Sia-Agent
header_down Access-Control-Allow-Origin *
}

View File

@ -41,6 +41,12 @@ server {
client_body_buffer_size 128k;
client_max_body_size 128k;
location /blacklist {
proxy_cache skynet;
proxy_cache_valid any 1m; # cache blacklist for 1 minute
proxy_pass http://siad-download/skynet/blacklist;
}
location /portals {
proxy_cache skynet;
proxy_cache_valid any 1m; # cache portals for 1 minute