Hi to all,
Everyday when I see error logs I find these logs
can someone tell me how to stop this we are not using PHP website or Wordpress we have Next Js app
Hi to all,
Everyday when I see error logs I find these logs
can someone tell me how to stop this we are not using PHP website or Wordpress we have Next Js app
Hi, @littatech! Welcome to the Vercel Community
You could try using Vercel WAF, specifically setting up:
- IP blocking: Learn how to configure IP blocking
- Custom rules: Learn how to configure custom rules for your project
- Managed rulesets: Learn how to enable managed rulesets for your project (Enterprise plan)
Let us know how you get on!
Hi pawlean,
Thank your for the response, but is there any way to identify IP address of that person from Vercel dashboard I want to block exact IP from that request.
Hi, @littatech!
Thank you for your patience
To find IP addresses to block on Vercel, you can use the X-Forwarded-For
header, which provides the IP address of the client making the request. You can then look for the X-Forwarded-For
header in the logs. This header will contain the IP address of the client.
You can create middleware in your application to log the X-Forwarded-For
header.
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(req: NextRequest) {
const clientIp = req.headers.get('x-forwarded-for') || req.ip;
console.log('Client IP:', clientIp);
return NextResponse.next();
}
Let us know how you get on!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
We now have a WAF template in case it is helpful, @littatech!