Varnish not able to differentiate between Mobile device & desktop

Varnish not able to differentiate between Mobile device & desktop. So, if you have different home pages for different type of devices, with same domain then in such case Varnish will return with the only version of a resource that it has cached for a particular URL — regardless of its appropriateness for the device performing the request.

If a mobile phone performs the first request for a resource, the request may return specific mobile content, and Varnish will likely cache it. However, if a desktop browser subsequently performs a request for the same resource, it may receive the mobile content that Varnish has cached. This could cause mobile-specific content to appear in the desktop browser.

How to solve this in cloudways?