# 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*
