Route HTTP to HTTPS [NGINX]
There is no magic here, just add the below to your Nginx config file
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
It is a server block that listens to the default port, and works for every server_name due to the underscore standing as a catch-all server_name _(you can target a specific server server_name http://website.com), finally does the rerouting by redirection to an https version of the protocol.
I hope this helps someone.
Salut



![Rewinding a remote branch [GIT]](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1595846859885%2FQXz3zux6i.png&w=3840&q=75)