mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-14 22:28:43 +02:00
API errors will no longer redirect
This commit is contained in:
@@ -88,7 +88,7 @@ check_err() {
|
|||||||
echo 'No route to host'
|
echo 'No route to host'
|
||||||
;;
|
;;
|
||||||
160)
|
160)
|
||||||
echo 'Incompatiable Elasticsearch upgrade'
|
echo 'Incompatible Elasticsearch upgrade'
|
||||||
;;
|
;;
|
||||||
161)
|
161)
|
||||||
echo 'Required intermediate Elasticsearch upgrade not complete'
|
echo 'Required intermediate Elasticsearch upgrade not complete'
|
||||||
|
|||||||
@@ -387,15 +387,13 @@ http {
|
|||||||
error_page 429 = @error429;
|
error_page 429 = @error429;
|
||||||
|
|
||||||
location @error401 {
|
location @error401 {
|
||||||
if ($request_uri ~* (^/connect/.*|^/oauth2/.*)) {
|
if ($request_uri ~* (^/api/.*|^/connect/.*|^/oauth2/.*)) {
|
||||||
return 401;
|
return 401;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request_uri ~* ^/(?!(^/api/.*))) {
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($request_uri ~* ^/(?!(api/|login|auth|oauth2|$))) {
|
if ($request_uri ~* ^/(?!(login|auth|oauth2|$))) {
|
||||||
add_header Set-Cookie "AUTH_REDIRECT=$request_uri;Path=/;Max-Age=14400";
|
add_header Set-Cookie "AUTH_REDIRECT=$request_uri;Path=/;Max-Age=14400";
|
||||||
}
|
}
|
||||||
return 302 /auth/self-service/login/browser;
|
return 302 /auth/self-service/login/browser;
|
||||||
|
|||||||
Reference in New Issue
Block a user