My Jupyter notebook (running on AWS EC2 instance) was working well (on port 8888) after following the steps mentioned here.
But then I decided to get a proper domain