Error 405 on POST method using ssl and pages hosting

Hello. I use express.js, ssl, and hosting on cloudflare pages. I use strict ssl setting. I set ssl to my server, but when i try to login using POST method there is 405 error. GET is working fine. What it can be?

Did you have this issue before the endpoint (Express) is on Cloudflare?

All was good and works fine. I using another hosting with classic virtual server with ubuntu. I run my web app on it. But after i start hosting on claoudlafe there is only GET method works… I have react and express frameworks in my web app.

I’m having a similar issue described here.

I’m building a dynamic SvelteKit application, which makes get and post requests to several URL. When hosting on Netlify, everything works as expected.

When hosting on Cloudflare Pages, the application loads very quickly — but when the application makes HTTP post requests, Cloudflare logs a 405 Method Not Allowed error in the browser.

From the Cloudflare site:

405 Method Not Allowed (RFC7231)

Origin server is aware of the requested resource, but the request method used is not supported. Origin server must also provide an Allow header with a list of supported targets for that resource.

An example would be a POST on an unchangeable resource the thus only accepts GET.

Is there any way I can adjust the HTTP post request to deal with this? For example, by adding headers like this to the fetch call?

    headers: {
      'Access-Control-Allow-Origin': '*',
      'Accept': '*/*',
      "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
      'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE'
    }
  }

Or do I need to do something involving workers or Cloudflare workers? Or any other fix?