How can I make HTTPS requests between two nodes that run in different environments (under the same env group)?
I need to use the default environment URL because I don't have a custom domain yet.
I have a client-server architecture composed of two environments:
- Server environment
- Application Server: Node.js (REST API)
- SQL Database: PostgreSQL
- NoSQL Database: Redis
- Client environment
- Application Server: Node.js (Next.js App)
I have successfully deployed all the services. Both applications (client and server) are reachable through the default URL of each environment using HTTPS.
But the requests made from the client (Next.js app) to the server (REST API) using the default environment URL, fail with the following error:
Failed connect to env_name.hoster_domain_name:443; Connection refused
The same happens if I SSH into the client environment and execute curl https://env_name.hoster_domain_name
, the confusing part is curl http://env_name.hoster_domain_name
works fine.
I read here that the LAN IP address should be used to establish an HTTP connection between the nodes (without going through the SLB). So, I tried doing that but, the browser is blocking the requests with the following error:
Mixed Content: The page at 'https://env_name.hoster_domain_name/resource_path' was loaded over HTTPS, but requested an insecure resource
As I understand this is because the connection between client and server is not secure.
Any hint on how to solve this would be greatly appreciated.