405 Method Not Allowed

feliperos19HOBBY

6 months 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

0 Replies

feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

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


6 months 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?


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

1311472535887675400


6 months ago

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


feliperos19HOBBY

6 months 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?


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

I'm sending a new backend deploy here


feliperos19HOBBY

6 months ago

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


6 months ago

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


feliperos19HOBBY

6 months 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?


feliperos19HOBBY

6 months ago

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


6 months ago

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


feliperos19HOBBY

6 months 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.


feliperos19HOBBY

6 months 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.


feliperos19HOBBY

6 months 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


feliperos19HOBBY

6 months ago

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


6 months ago

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


6 months ago

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


feliperos19HOBBY

6 months 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


6 months ago

well go ahead and get this working on the public network


feliperos19HOBBY

6 months 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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months 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.


6 months ago

you don't seem rude but I appreciate you letting me know ๐Ÿ™‚


6 months ago

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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months 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?


6 months ago

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


feliperos19HOBBY

6 months ago

1311487882602614800


feliperos19HOBBY

6 months 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.


6 months ago

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


feliperos19HOBBY

6 months 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


6 months ago

was this sending 16mb of data?


feliperos19HOBBY

6 months ago

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


feliperos19HOBBY

6 months ago

It was a joke to break some of the embarrassment


6 months ago

that's okay, I didn't study anything


feliperos19HOBBY

6 months 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.


feliperos19HOBBY

6 months 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!


6 months ago

sounds like a good plan!


6 months ago

happy to help!


feliperos19HOBBY

6 months ago

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


6 months ago

you as well!


6 months ago

!s


Status changed to Solved brody โ€ข 6 months ago