Replies: 3 comments
|
Hey, I ran into something super similar a while back, so hopefully this helps! When your Node.js app works fine on Render.com but throws a 500 error on cPanel (especially when it’s hitting a third-party API), it’s usually down to two things in my experience:
If you can get your hands on the actual error log, it will probably point to which of these two is causing the mess. But yeah, 99% of the time for me, it’s been one of those! Hope this helps. let me know what you find! |
|
This usually happens on cPanel due to outbound request restrictions or Node runtime differences. First check your server error logs to confirm if the request is actually reaching the third-party API. In many shared hosting setups, outgoing HTTPS requests are blocked or limited, which causes a 500 error even if the same code works on Render or other cloud platforms. Also verify that your Node version and environment variables on cPanel match your deployment on Render. |
|
Since the same application works on Render but fails on cPanel, I would first verify whether the problem is the application itself or the hosting environment. Try calling the third-party API directly from the cPanel server: curl -v https://the-third-party-api-url.com/ If that request also fails, the issue is most likely related to outbound HTTPS connections, DNS resolution, firewall rules, or restrictions imposed by the hosting provider. If curl works, then log the actual Node.js error instead of only returning HTTP 500. For example: try { I would also compare these between Render and cPanel: Node.js version: node -v If you can share the actual error message from the Node.js process or cPanel logs, it should be possible to narrow the cause down much further. |
Uh oh!
There was an error while loading. Please reload this page.
Nodejs web application on cpanel giving error 500 when trying to connect with third party API, works well on render.com.
Please help
All reactions