forked from vouch/vouch-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx_scopes_and_claims.conf
33 lines (27 loc) · 1001 Bytes
/
nginx_scopes_and_claims.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
server {
listen 80;
server_name mydomain.com;
location ^~ /sso/validate {
proxy_pass http://vouch:9090/validate;
proxy_set_header Host $http_host;
proxy_pass_request_body off;
}
location ^~ /api/v1/ {
auth_request /sso/validate;
# get the claim/s into a local nginx variable
auth_request_set $sub $upstream_http_x_vouch_idp_claims_sub;
auth_request_set $email $upstream_http_x_vouch_idp_claims_email;
auth_request_set $verified $upstream_http_x_vouch_idp_claims_email_verified;
# forward the claim to the proxied server
proxy_set_header X-sub $sub;
proxy_set_header X-email $email;
proxy_set_header X-email-verified $verified;
# generic proxy headers
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://api./;
}
}