405 Method Not Allowed
feliperos19
FREEOP

a year ago

Good evening, sorry to bother you again. I'm having a problem with Cors when I try to use in my axios client (frontend project in react with typescript) the internal URL of my backend service (helpcenter-backend.railway.internal) for some reason it keeps giving 405 Method Not Allowed but when I use the URL "web.helpcentercorp.com" within the axios configuration I don't have the same problem, I configured the origin within the backend to be the internal URL of my frontend (helpcenter-frontend.railway.internal) and even so it can't accept the request.

Solved

50 Replies

feliperos19
FREEOP

a year ago

f4cdcd7f-0c97-47cc-826e-9ffd1fd64620


feliperos19
FREEOP

a year ago

frontend link: https://helpcentercorp.com/login
user: admin@admin.com
password: 1234


brody
EMPLOYEE

a year ago

Good evening, sorry to bother you again.
Good evening yourself, and you are never a bother!

is your frontend next? and are you making the requests on the server side?


feliperos19
FREEOP

a year ago

This link I sent is for the frontend that makes requests to the backend in Java (I didn't quite understand the question)


feliperos19
FREEOP

a year ago

I'm doing a new deployment to check a specific situation that might solve the problem


feliperos19
FREEOP

a year ago

1311472535887675400


brody
EMPLOYEE

a year ago

how do you know /api/auth/authenticate is the correct path?


feliperos19
FREEOP

a year ago

Yes, the path is correct. I saw in the print that there is a concatenation of the URL + internal URL. Could that be it? Or is it the sending standard?


feliperos19
FREEOP

a year ago

This URL was previously used when we sent to https://web.helpcentercorp.com


feliperos19
FREEOP

a year ago

I'm sending a new backend deploy here


feliperos19
FREEOP

a year ago

I want to configure this internal network system to avoid sending traffic to cloudflare from the frontend to the backend


brody
EMPLOYEE

a year ago

your frontend is client side rendered, you need to use the public url


feliperos19
FREEOP

a year ago

I understand, so in this case I really need to send all the traffic to Cloudflare, I'm going to add the public URL back into the system, do you know if there's any way to solve this? Or just rebuilding the project architecture?


feliperos19
FREEOP

a year ago

something with SSR would have to be used to return the built components


brody
EMPLOYEE

a year ago

why do you think you need cloudflare or the private url here?


feliperos19
FREEOP

a year ago

I'm very layman so I'll try to explain the problem the way I'm seeing it, my request at the moment is taking a long time to complete while in a controlled environment (few resources) on a local network where I just point directly to the server within the same network the request takes much less time to complete, I tried to reduce the request delay as much as possible via code but now it's a network issue for me.


feliperos19
FREEOP

a year ago

I am located in Brazil so I already imagined the latency but the person using the system is in Connecticut and has almost the same delay problem.


feliperos19
FREEOP

a year ago

so I imagine that making the request directly on an internal URL would be faster than sending it to Cloudflare to resolve the DNS and then sending it to my backend


feliperos19
FREEOP

a year ago

I really don't understand much about this part of the structure


brody
EMPLOYEE

a year ago

i see where you are coming from, but i think the solution you are seeking out is not the correct path forward


brody
EMPLOYEE

a year ago

so first off, get the 405 problem solved, dont worry about the private network or cloudflare


feliperos19
FREEOP

a year ago

I went in this direction because when I configure my "origin" to accept requests from the registered cloudflare domain it doesn't give me this same problem and I was judging it as a Cors problem


brody
EMPLOYEE

a year ago

well go ahead and get this working on the public network


feliperos19
FREEOP

a year ago

This is my cors configuration within the backend, that "allowedOrigin" variable is receiving within the dev environment my frontend localhost + port and within railway it is using the cloudflare address https://helpcentercorp.com

1311482475561881900


feliperos19
FREEOP

a year ago

I'll set it up again and let you know.


feliperos19
FREEOP

a year ago

Now the system is working normally again, I configured it to access via external URL


feliperos19
FREEOP

a year ago

https://helpcentercorp.com/login
email: admin@admin.com
password: 1234


feliperos19
FREEOP

a year ago

with this external URL there is no 405 error or anything like that


feliperos19
FREEOP

a year ago

an off-topic question, if any of my messages seem rude it is because of Google Translate, my English is very bad so I am using it to help me, I really appreciate all the effort put into helping me with these questions.


brody
EMPLOYEE

a year ago

you don't seem rude but I appreciate you letting me know 🙂


brody
EMPLOYEE

a year ago

awesome, now what response times are you seeing, and for what endpoints?


feliperos19
FREEOP

a year ago

the endpoint https://helpcentercorp.com/order/2 is very slow


feliperos19
FREEOP

a year ago

One of the possible reasons is loading large files (blob)


feliperos19
FREEOP

a year ago

I'm going to test a different implementation, but for the sake of knowledge, is there a way to create using the local URL? or something like that, in case I'm going down the wrong path, is keeping the public URL really the best option?


brody
EMPLOYEE

a year ago

Unfortunately being very slow is not too helpful please provide real numbers


feliperos19
FREEOP

a year ago

1311487882602614800


feliperos19
FREEOP

a year ago

I apologize for the expression, but I ended up checking the values ​​sent within the payload and there were 16.0 MB transferred, so I went straight to another question.


brody
EMPLOYEE

a year ago

this is a frontend app where the requests are made from the user's browser, you need to use the public domain


feliperos19
FREEOP

a year ago

Now I completely understand the issue (sorry for the delay), so I will have to maintain this structure and in fact localhost is a version of how it is used but within my ecosystem


brody
EMPLOYEE

a year ago

was this sending 16mb of data?


feliperos19
FREEOP

a year ago

and you may not believe me but I study computer science and yet I had these questions about how the internet works lol


feliperos19
FREEOP

a year ago

It was a joke to break some of the embarrassment


brody
EMPLOYEE

a year ago

that's okay, I didn't study anything


feliperos19
FREEOP

a year ago

2 blob files were requested within the body, which are PDFs, so the request needed to send 16MB. I will cut these two pieces of information from the payload and create an additional endpoint.


feliperos19
FREEOP

a year ago

I really appreciate your time and effort in helping me with all the related issues, I learned a lot about how this whole network thing works and it is knowledge that I will take with me for life, again thank you for everything!


brody
EMPLOYEE

a year ago

sounds like a good plan!


brody
EMPLOYEE

a year ago

happy to help!


feliperos19
FREEOP

a year ago

I wish you a great night (here in Brazil it's 9pm) and thank you very much again!


brody
EMPLOYEE

a year ago

you as well!


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...