NGINX: Difference Between ~ and ~* Tildes

The difference is that ~ is case-sensitive while ~* is not case-sensitive.

In the example below, the path /admin/ would match while /Admin/ would not:

location ~ ^/admin/$ {
    return 301 https://$host/;
}

In this example, both /admin and /Admin/ would match and be redirected:

location ~* ^/admin/$ {
    return 301 https://$host/;
}