-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use DRY templates. Now adding services is much simplier.
- Loading branch information
Showing
5 changed files
with
46 additions
and
71 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
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,14 @@ | ||
# Requests must be authenticated | ||
auth_request /auth-proxy; | ||
|
||
# Relay the REMOTE_USER and X-WEBAUTH-USER headers | ||
# From the response of the authentication request | ||
# To the service | ||
auth_request_set $remoteUser $upstream_http_REMOTE_USER; | ||
proxy_set_header REMOTE_USER $remoteUser; | ||
|
||
auth_request_set $xWebauthUser $upstream_http_X_WEBAUTH_USER; | ||
proxy_set_header X-WEBAUTH-USER $xWebauthUser; | ||
|
||
# redirect 401 and 403 to login form | ||
error_page 401 403 /login; |
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,22 @@ | ||
location /login { | ||
proxy_pass http://authenticator/login; | ||
proxy_set_header Host $host:$server_port; | ||
proxy_set_header X-Original-URI $request_uri; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
} | ||
|
||
location /auth-proxy { | ||
internal; | ||
|
||
proxy_pass http://authenticator/; | ||
|
||
proxy_pass_request_body off; | ||
proxy_set_header Content-Length ""; | ||
|
||
proxy_set_header X-Real-IP $remote_addr; | ||
|
||
# Login service returns a redirect to the original URI | ||
# and sets the cookie for the authenticator | ||
proxy_set_header X-Original-URI $request_uri; | ||
proxy_set_header Host $host:$server_port; | ||
} |