I am encountering an issue with API requests from my React frontend, hosted on Cloudflare, to my Node backend, hosted on an Azure Windows VM. The API requests work correctly in my local development environment where I don’t have a certificate installed. However, in the production environment with the certificate installed on the Azure Windows VM, the API requests fail to retrieve the expected results from a Cosmos database.
Here are the details and steps I have taken so far to troubleshoot the issue:
API Request Behavior:
When making API requests from the React frontend hosted on Cloudflare, the response is not as expected.
The API requests are intended to query and return results from a Cosmos database.
The same API requests work perfectly fine in my local development environment without a certificate.
Network Connectivity:
I have checked the network connectivity and confirmed that the production environment has proper network access to the Azure Windows VM.
There are no network restrictions or firewalls blocking the API requests, as I have reviewed the firewall rules on both Cloudflare and the Azure Windows VM.
API Configuration:
I have verified that the Azure Windows VM hosting the Node backend is properly configured and running.
The API endpoint is accessible, and I have used tools like cURL and Postman to directly make requests to the API endpoint, confirming that it returns the expected response.
Query Parameters:
I have double-checked the query parameters being passed to the API request in the production environment and ensured that the title query parameter is correctly passed and matches the expected format on the server-side.
Server-side Code:
I have reviewed the server-side code that handles the API request and confirmed that it works correctly in the local development environment.
There are no apparent differences or misconfigurations between the development and production environments in terms of the server-side code.
Cloudflare Settings:
I have checked the Cloudflare settings, including DNS configuration, caching settings, and firewall rules.
I have temporarily paused Cloudflare to bypass it and test the API requests directly, but the issue still persists.
Despite these troubleshooting steps, I am unable to identify the root cause of the problem. I am seeking assistance from the Cloudflare community to help me resolve this issue and ensure that the API requests from my React frontend to the Node backend function correctly in the production environment.
Any guidance, suggestions, or additional troubleshooting steps to resolve this issue would be greatly appreciated.
Thank you for your help.
Best regards,
Susan