There are two things wrong.
You should not try http://
But https://
For that you need a server certificate but these are free from e.g.
https://letsencrypt.orgAuthentication for http is
not recommended. (Basically: does not exist!!!!)
You are a beginner, start from the right place.
Then again, provided you use httpS, leledumbo's example should work.