SSL connection issue when frontend tries to reach backend API

I’m having trouble with my web app. The frontend loads over HTTPS but can’t connect to the backend API. I keep getting this error in the console:

GET https://example-site.com:8082/api/start net::ERR_SSL_PROTOCOL_ERROR

My nginx config seems fine. It’s set up to redirect HTTP to HTTPS and proxy API requests to the backend. I’ve double-checked the SSL certificate paths too.

In my Docker setup, the frontend container exposes ports 80 and 443, while the backend uses 8082 and 8443.

Weirdly, I can curl the API endpoint over HTTP without issues. But the frontend just won’t connect properly.

I’ve tried a bunch of things but nothing’s working. Any ideas what could be causing this SSL error? I’m totally stuck!

have u checked if ur backend is actually using SSL? sounds like it might be serving HTTP on 8082. try switching the frontend to use http://example-site.com:8082/api/start instead and see if that works. if it does, you’ll need to set up SSL on ur backend too. good luck!

This SSL issue sounds frustrating. Based on your description, it seems the problem lies in how your frontend is trying to communicate with the backend. Even though your nginx is set up for HTTPS, your frontend appears to be attempting to connect directly to the backend on port 8082, which might not be configured for SSL.

Try modifying your frontend code to make API calls to ‘/api/start’ instead of the full URL with port. This way, nginx can properly proxy the request to your backend. Alternatively, ensure your backend is correctly set up to handle HTTPS on port 8443, and update your frontend to use that port instead.

If those don’t work, double-check your Docker network setup. Ensure the containers can communicate properly and that the backend’s SSL certificate is valid and trusted by the frontend container. Good luck troubleshooting!

hmm, interesting problem! have u tried checking if the backend container is actually listening on the right port? maybe try docker ps to see what ports are exposed. also, whats ur docker-compose file look like? sometimes network issues can pop up there. let me know if u want me to take a peek at ur config!