We have this section in our documentation that explains how to force HTTPS and the non-www domain in our NGINX solutions, can you take a look at it?
Regarding the Bitnami solution you are using, you mentioned that you were using Node.js in AWS but that solution doesn't include NGINX. Don't know if you installed the server separately or if you are using other Bitnami solution though.
The error you mentioned looks like you are not using the Bitnami NGINX server so I don't know if there is something wrong in the system's NGINX server. Please note that we tested our documentation steps using the Bitnami solutions, not the system's services.