Say you have two development sites hosted as Nginx virtual servers locally, on 127.0.0.1. If you curl http://127.0.0.1, you will get one or the other site, depending on which one is considered the default one by Nginx.

You can make sure to get the one you want by setting the Host header with -H 'Host: hostname'. In that case Nginx will choose the correct virtual server.

But now if you use https instead of http, this will fail as the certificate for that hostname is for a real IP, not 127.0.0.1. Curl provides the --resolve option for that use case.