I tried the following solution: This one
But that does not work. I want all HTTP to be redirected to HTTPS except for /api/iot as setting up HTTPS connection on my io