Thank you for reaching out.
The error url parameter not allowed in browser is not caused by YARP. YARP forwards query strings (like w and q) by default, so there’s no special configuration needed for that. The problem comes from Next.js Image Optimization security rules. Next.js blocks requests with a url parameter unless the image source is explicitly trusted. This is a security measure to prevent SSRF (Server-Side Request Forgery).
Next.js requires you to whitelist remote image sources in next.config.js. If your images are served from http://localhost:5002/UploadedFiles/... via YARP, Next.js will reject them unless you configure this.
Add your image origin to next.config.js under images.remotePatterns:
"module.exports = {
images: {
remotePatterns: [
{
protocol: 'http',
hostname: 'localhost',
port: '5002',
pathname: '/UploadedFiles/**',
},
],
},"
Then restart your Next.js app. After this, the <Image> component will work with query parameters like w=640&q=75 without errors.
Please let us know if you require any further assistance, we’re happy to help.
If you found this information useful, kindly mark this as "Accept Answer".