trying to get vouch proxy config to get written
This commit is contained in:
parent
5c4a3145b4
commit
5ebc1f433f
1 changed files with 2 additions and 5 deletions
|
@ -388,7 +388,7 @@ server {
|
||||||
include /etc/nginx/vhost.d/default;
|
include /etc/nginx/vhost.d/default;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if $vouch_internal_location }}
|
{{ if ne $vouch_internal_location "" }}
|
||||||
auth_request /vouchValidate;
|
auth_request /vouchValidate;
|
||||||
|
|
||||||
location = /vouchValidate {
|
location = /vouchValidate {
|
||||||
|
@ -411,16 +411,13 @@ server {
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if $vouch_external_location }}
|
{{ if ne $vouch_external_location "" }}
|
||||||
# if validate returns `401 not authorized` then forward the request to the error401block
|
# if validate returns `401 not authorized` then forward the request to the error401block
|
||||||
error_page 401 = @error401;
|
error_page 401 = @error401;
|
||||||
|
|
||||||
location @error401 {
|
location @error401 {
|
||||||
# redirect to Vouch Proxy for login
|
# redirect to Vouch Proxy for login
|
||||||
return 302 https://{{ $vouch_external_location }}/login?url=$scheme://$http_host$request_uri&vouch-failcount=$auth_resp_failcount&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err;
|
return 302 https://{{ $vouch_external_location }}/login?url=$scheme://$http_host$request_uri&vouch-failcount=$auth_resp_failcount&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err;
|
||||||
# you usually *want* to redirect to Vouch running behind the same Nginx config proteced by https
|
|
||||||
# but to get started you can just forward the end user to the port that vouch is running on
|
|
||||||
# return 302 http://vouch.yourdomain.com:9090/login?url=$scheme://$http_host$request_uri&vouch-failcount=$auth_resp_failcount&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err;
|
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue