Skip to content

Commit 2c7b558

Browse files
authored
Update README.md
Signed-off-by: Zoey <[email protected]>
1 parent cb0f5b7 commit 2c7b558

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -217,26 +217,20 @@ upstream service2 {
217217
1. create a custom location / (or the location you want to use), set your proxy settings, then press the gear button and paste the following in the new text field, you may need to adjust the last lines:
218218
```
219219
auth_request /outpost.goauthentik.io/auth/nginx;
220+
error_page 401 = @goauthentik_proxy_signin;
221+
auth_request_set $auth_cookie $upstream_http_set_cookie;
222+
more_set_headers 'Set-Cookie: $auth_cookie';
220223
auth_request_set $authentik_username $upstream_http_x_authentik_username;
221224
auth_request_set $authentik_groups $upstream_http_x_authentik_groups;
222-
auth_request_set $authentik_entitlements $upstream_http_x_authentik_entitlements;
223225
auth_request_set $authentik_email $upstream_http_x_authentik_email;
224226
auth_request_set $authentik_name $upstream_http_x_authentik_name;
225227
auth_request_set $authentik_uid $upstream_http_x_authentik_uid;
226228
proxy_set_header X-authentik-username $authentik_username;
227229
proxy_set_header X-authentik-groups $authentik_groups;
228-
proxy_set_header X-authentik-entitlements $authentik_entitlements;
229230
proxy_set_header X-authentik-email $authentik_email;
230231
proxy_set_header X-authentik-name $authentik_name;
231232
proxy_set_header X-authentik-uid $authentik_uid;
232233
233-
auth_request_set $auth_cookie $upstream_http_set_cookie;
234-
more_set_headers 'Set-Cookie: $auth_cookie';
235-
236-
error_page 401 =302 /outpost.goauthentik.io/start?rd=$scheme://$host$request_uri;
237-
# For domain level, use the below error_page to redirect to your authentik server with the full redirect path
238-
#error_page 401 =302 https://authentik.company/outpost.goauthentik.io/start?rd=$scheme://$host$request_uri;
239-
240234
# This section should be uncommented when the "Send HTTP Basic authentication" option is enabled in the proxy provider
241235
#auth_request_set $authentik_auth $upstream_http_authorization;
242236
#proxy_set_header Authorization $authentik_auth;
@@ -245,10 +239,19 @@ error_page 401 =302 /outpost.goauthentik.io/start?rd=$scheme://$host$request_uri
245239
```
246240
auth_request_set $auth_cookie $upstream_http_set_cookie;
247241
more_set_headers 'Set-Cookie: $auth_cookie';
248-
proxy_method GET;
249242
proxy_pass_request_body off;
250243
proxy_set_header Content-Length "";
251244
```
245+
3. paste the following in the advanced config tab, you may need to adjust the last lines:
246+
```
247+
location @goauthentik_proxy_signin {
248+
internal;
249+
add_header Set-Cookie $auth_cookie;
250+
return 302 /outpost.goauthentik.io/start?rd=$request_uri;
251+
# For domain level, use the below error_page to redirect to your authentik server with the full redirect path
252+
# return 302 https://authentik.company/outpost.goauthentik.io/start?rd=$scheme://$http_host$request_uri;
253+
}
254+
```
252255

253256
### authelia config example (no guarantee for security of it)
254257
1. create a custom location / (or the location you want to use), set your proxy settings, then press the gear button and paste the following in the new text field, you may need to adjust the last lines:

0 commit comments

Comments
 (0)