Peanuts and tree nuts are classified separately as allergens for food labelling.
Coconut is not included as a nut for this purpose, so a product containing coconut will not be labelled as containing nuts. Allergies to coconut are rare, apparently.
In the UK products containing pine nuts aren’t labelled as containing nuts either, but in the US they are.
In the UK, if something is labelled as containing tree nuts, it’ll contain one or more of the following:
almonds, hazelnuts, walnuts, cashews, pecan nuts, Brazil nuts, pistachio nuts, and macadamia nuts.
The labels always say tree nuts to distinguish them from ground nuts (peanuts), but many people who are allergic to peanuts are also allergic to at least one type of tree nut. Cashews and pistachio nuts are closely related, as are walnuts and pecans, so someone allergic to a pistachio is quite likely to be allergic to a cashew too, for example.
If someone says they’re allergic to nuts without giving more information, I would try to avoid all the tree nuts and peanuts too. Another issue is that a place that processes one type of nut often processes another, so there can be ‘may contain traces’ warnings.
DS has nut/peanut allergies and we have the same issue with seeds. Many are processed in facilities that process nuts too.