CORS Error on Form Submission in Reverse Proxy Setup

41 views Asked by At

I'm using NextJS URL Rewrites as a reverse proxy by configuring rules through next.config.

I am rewriting to an app which requires a cookie to be present, otherwise it requires the user to login first. Html, css, scripts and assets are loaded correctly.

Put graphically: Browser ---> NextJS app(proxy) --(rewrite)--> SomeApp --(form submit)--> form backend

Submitting the form from SomeApp makes a POST request to the form backend, which returns a CORS error. I understand why this is happening, but I cannot come up with an idea to solve this.

Is there a way to solve this through next.config rewrites? or should I look for another option?

Thank you.

0

There are 0 answers