So I have a BUN application deployed on render
I’m using express for the http server and I have set every possible file upload limit to the maximum.
My web app is a react.js app which is using axios to make requests.
I want to upload formData to my server from the client and it is working fine if I host my server on localhost. Render’s proxy is responding to my client’s request with a 413 Payload Too Large error and my bun app does not even get any request on that route. My client formData upload is just rejected after 1 or 2 minutes.
Can I somehow set the upload limit on render’s proxy?
What is the solution?
I have these setup
const app = express();
const payloadLimit = 2000 * 1024 * 1024; // 2000 MB in bytes
const appOptions = {
extended: true,
limit: payloadLimit,
parameterLimit: payloadLimit,
};
app.use(LoggerMW);
app.use(cors(globalCorsOptions));
app.use(json({ ...appOptions }));
app.use(urlEncoded({ ...appOptions }));
LoggerMW is a middleware which logs every http request
Just this
export function LoggerMW(req: Request, res: Response, next: NextFunction): void {
logger.info(`HTTP Request - M: ${req.method} URI: ${req.originalUrl}`);
next();
}
I can’t see my upload is logged anywhere and the logging is not logging on the upload route also.
This is what I get on client side from render’s proxy ( I’m sure this request is not reaching my app )
Request method: POST
Status code: 413 Payload Too Large
Referrer policy: strict-origin-when-cross-origin
alt-svc: h3=":443"; ma=86400
cf-cache-status: DYNAMIC
cf-ray: 901c59badad75acb-VIE
date: Tue, 14 Jan 2025 08:47:42 GMT
priority: u=1,i
rndr-id: 77b1ca73-a52e-43c7
server: cloudflare
server-timing: cfExtPri
vary: Accept-Encoding
x-render-origin-server: Render