disable arcjet on healthchecks
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
parent
d6710bccd1
commit
9b0f7f6e33
@ -13,7 +13,7 @@ spec:
|
||||
service: techaro-lol
|
||||
port: 80
|
||||
replicas:
|
||||
min: 0
|
||||
min: 1
|
||||
max: 10
|
||||
scaledownPeriod: 300
|
||||
scalingMetric:
|
||||
|
@ -44,10 +44,12 @@ spec:
|
||||
type: RuntimeDefault
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
path: /_healthz
|
||||
port: 3000
|
||||
httpHeaders:
|
||||
- name: X-Real-Ip
|
||||
value: "127.0.0.1"
|
||||
- name: x-real-ip
|
||||
value: "100.100.100.100"
|
||||
- name: user-agent
|
||||
value: "Kubernetes healthchecks"
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 3
|
@ -4,7 +4,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
export const config = {
|
||||
// matcher tells Next.js which routes to run the middleware on.
|
||||
// This runs the middleware on all routes except for static assets.
|
||||
matcher: ["/((?!_next/static|_next/image|favicon.ico).*)"],
|
||||
matcher: ["/((?!_next/static|_next/image|favicon.ico|/_healthz).*)"],
|
||||
};
|
||||
|
||||
const aj = arcjet({
|
||||
@ -30,6 +30,7 @@ export default async function middleware(request: NextRequest) {
|
||||
console.log(req.ip);
|
||||
|
||||
const decision = await aj.protect(req);
|
||||
console.log(decision);
|
||||
|
||||
if (
|
||||
// If this deny comes from a bot rule then block the request. You can
|
||||
|
Loading…
x
Reference in New Issue
Block a user