How to redirect from http to https in WordPress

Thanks to Let’s Encrypt and WordPress projects today is very easy to migrate your site from http to https. The following procedure also works for those sites that are behind a reverse proxy like NGINX and the connection between the proxy and the site is done via http, even if you cannot modify the web server configuration.