405 Method Not Allowed on Cloudflare Pages

Hi dear community,

I am new on this forum so please excuse me if I am writing in the wrong category or my question is not complete.

We have a simple frontend based on VueJS which has been deployed on Cloudflare Pages and a backend based on Djangorestframework which has been deployed on a VPS.

When we run the frontend locally it can connect to the previously-deployed backend but when we deploy the frontend on Cloudflare Pages we get the following error when a user wants to login:

[HTTP/1.1 405 Not Allowed 29ms]

and also

Status       405 Method Not Allowed
Version      HTTP/3
Transferred  2.22 KB (0 B size)
Referrer     Policystrict-origin-when-cross-origin

I would be happy for any help.

PS1: forgot to mention that the method which is being used is POST.

1 Like

What method is being used to login in? Is it a POST method?

yes, POST method.

If you open dev tools when logging in is it saying that is being blocked because of CORS?

This is what I get.
Photo 1:

Photo2:
2

What is the difference between the local hosted version and the version in Cloudflare pages? Is the local version connected to the IP vs the Pages connected to the hostname?

Worth checking Cloudflare’s firewall to see if those requests have been blocked.

There is no difference between them. Both of them use hostname.

This is the vue.config.js file:

module.exports = {
  devServer: {
    proxy: {
      "/accounts/": {
        target: "https://my-api-server-is-here.com",
        changeOrigin: true,
        secure: false,
      },
    },
  },
};

I haven’t created firewall rules and also checked the firewall section. Nothing indicates that they have been blocked by Cloudflare firewall.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.