diff --git a/nginx.conf b/nginx.conf index 80e5114c4..4d6738a51 100644 --- a/nginx.conf +++ b/nginx.conf @@ -114,6 +114,23 @@ http { location / { proxy_pass http://webserver; } + location ~ ^/isbn/([0-9Xx-]+)$ { + set $isbn_number $1; + + resolver 8.8.8.8 valid=30s; + + proxy_set_header Host openlibrary.org; + + proxy_hide_header Access-Control-Allow-Origin; + add_header Access-Control-Allow-Origin *; + + + proxy_pass https://openlibrary.org/isbn/$isbn_number.json; + + + proxy_ssl_server_name on; + proxy_ssl_protocols TLSv1.2 TLSv1.3; + } } }