Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next.config.js] rewrites be able to change the proxyTimeout #36586

Closed
viniciusbitt opened this issue Apr 30, 2022 · 0 comments
Closed

[next.config.js] rewrites be able to change the proxyTimeout #36586

viniciusbitt opened this issue Apr 30, 2022 · 0 comments

Comments

@viniciusbitt
Copy link

viniciusbitt commented Apr 30, 2022

Describe the feature you'd like to request

I am creating a site in Next.JS and my server in Express and I am doing rewrite inside next.config.js pointing to my server.

const nextConfig = {
  async rewrites() {
    return [
      {
        source: "/api/:path*",
        destination: `${server.url}api/:path*`
      },
    ];
  },
};

But there's a problem, I can't make a request to my server and the response takes longer than 30 seconds, because the following error appears:

Error: Socket hang up

Also happens if I am using for example Socket.IO, where this error appears in the console.

Describe the solution you'd like

Checking where the possible problem is, I realized it is on this lines:

const proxy = new HttpProxy({
target,
changeOrigin: true,
ignorePath: true,
xfwd: true,
proxyTimeout: 30_000, // limit proxying to 30 seconds
})

where proxyTimeout is being limited to 30 seconds.

Thinking about a solution, I believe it should be possible to configure proxyTimeout.

Related issues:
#36251

Related discussions:
#24805

Describe alternatives you've considered

N/A

@vercel vercel locked and limited conversation to collaborators May 1, 2022
@timneutkens timneutkens converted this issue into discussion #36598 May 1, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant