Proper way to enforce https only?

Did anyone ever find a solution for this, I am still seeing the same problem on docker, AWS, distillery.