How can I configure Vercel WAF on my app? Seeing several suspicious logs

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 :smile:

You could try using Vercel WAF, specifically setting up:

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 :pray:

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.

For example:
 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! :smile: