-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cloudflare http01 auth folder and redirect and some oauthproxy …
…configs to meddle with
- Loading branch information
root
committed
Mar 21, 2018
1 parent
d492860
commit bb9c030
Showing
3 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Forwards to authentication proxy | ||
auth_request /oauth2/auth; | ||
error_page 401 = /oauth2/sign_in; | ||
|
||
# pass information via X-User and X-Email headers to backend, | ||
# requires running with --set-xauthrequest flag | ||
auth_request_set $user $upstream_http_x_auth_request_user; | ||
auth_request_set $email $upstream_http_x_auth_request_email; | ||
auth_request_set $token $upstream_http_x_auth_request_access_token; | ||
|
||
proxy_set_header X-Oauth-User $user; | ||
proxy_set_header X-Oauth-Email $email; | ||
proxy_set_header X-Oauth-Access-Token $token; | ||
|
||
# if you enabled --cookie-refresh, this is needed for it to work with auth_request | ||
auth_request_set $auth_cookie $upstream_http_set_cookie; | ||
add_header Set-Cookie $auth_cookie; | ||
|
||
# Always send the real client IP to the back end | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
|
||
# Send TLS SNI to the back end server | ||
proxy_ssl_server_name on; | ||
|
||
# Websocket upgrading | ||
proxy_http_version 1.1; | ||
proxy_pass_request_headers on; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; |
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,16 @@ | ||
# Do I really need these? | ||
underscores_in_headers on; | ||
ignore_invalid_headers off; | ||
|
||
location = /oauth2/auth { | ||
internal; | ||
proxy_pass http://127.0.0.1:4180; | ||
} | ||
|
||
location /oauth2/ { | ||
proxy_pass http://127.0.0.1:4180; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Scheme $scheme; | ||
} | ||
|
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