Skip to content

Instantly share code, notes, and snippets.

@bgautrea
Created February 10, 2020 14:32
Show Gist options
  • Save bgautrea/231ef781b408204594e7c749f6feaa2c to your computer and use it in GitHub Desktop.
Save bgautrea/231ef781b408204594e7c749f6feaa2c to your computer and use it in GitHub Desktop.
subrequest_output_buffer_size 32k;
#
# API definition
#
location /api/f1 {
limit_except GET {}
set $upstream f1_ergast;
rewrite ^ /_f1 last;
}
# Policy section
#
location = /_jwks_uri {
internal;
proxy_method GET;
proxy_cache jwk; # Cache responses
proxy_pass https://login.microsoftonline.com/<TENENT_ID>/discovery/v2.0/keys;
}
location = /_f1 {
internal;
set $api_name "Ergast";
auth_jwt "Foo";
auth_jwt_key_request /_jwks_uri;
proxy_set_header Host "ergast.com";
proxy_pass https://$upstream$request_uri;
}
# vim: syntax=nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment