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.
0 Replies
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?
This link I sent is for the frontend that makes requests to the backend in Java (I didn't quite understand the question)
I'm doing a new deployment to check a specific situation that might solve the problem
6 months ago
how do you know /api/auth/authenticate
is the correct path?
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?
This URL was previously used when we sent to https://web.helpcentercorp.com
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
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?
6 months ago
why do you think you need cloudflare or the private url here?
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.
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.
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
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
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
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
Now the system is working normally again, I configured it to access via external URL
https://helpcentercorp.com/login
email: admin@admin.com
password: 1234
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?
the endpoint https://helpcentercorp.com/order/2 is very slow
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
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
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?
and you may not believe me but I study computer science and yet I had these questions about how the internet works lol
6 months ago
that's okay, I didn't study anything
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.
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!
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