Your comments

I have a fully functional setup but when I add the code Maxim Lanin suggests the redirection is activated however the site stops working. Should I configure nginx conf or any other file prior to adding this code? A full guide of configuring redirections on nginx including http to https, non-www to www, and SSL installation would really help. Thanks