forked from vouch/vouch-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17c437e
commit 84ff937
Showing
2 changed files
with
39 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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./; | ||
} | ||
} |