Search code examples
reactjsamazon-web-serviceshttpsamazon-elastic-beanstalknetlify

Communicating with elastic beanstalk from netlify using POST requests


I'm running a react app frontend on Netlify which should ideally send commands to an elastic beanstalk backend in form of POST calls. Netlify is bound to my own purchased domain (myname.com) and the beanstalk is running the default address (XXXXXX.elasticbeanstalk.com).

Now the problem is Netlify won't allow sending POST calls to an unsecured (HTTP) endpoint, and requires the endpoint be https://XXXXX.elasticbeanstalk.com. I have pretty limited knowledge on how HTTPS actually works, so anything below this is me fumbling around in the dark and may be quite incorrect.

I tried several methods of enabling HTTPS on the beanstalk

  1. Create a self signed request on beanstalk and upload the cert to netlify (apparently they do not allow it)
  2. Create a CSR on beanstalk and sign it from let's encrypt (not working because I think beanstalk domain is not owned by me)
  3. Use Amazon certificate service (certificate got created but netlify still says it's a self signed certificate, and cannot allow the connection)

Anyone know how to either

  1. Allow netlify to call my HTTP endpoint or
  2. Make the beanstalk endpoint HTTPS or
  3. Suggest a different place to host my react frontend app that doesn't involve this HTTPS mess

Note: At this point, I'm not really worried about the security, and even an unsecure platform would work for now.

Thanks


Solution

  • Finally managed to solve it using CORS-anywhere proxy, by adding the endpoint as https://cors-everywhere.herokuapp.com/http://xxxx.elasticbeanstalk.com/my-endpoint