That is, by stopping *eating* anything that has onions in it.
It's probably coming through from the food you eat. The inner thigh at the top has a lot of sweat glands that seem pretty directly related to diet. You can test this theory by stopping anything that has onions for seasoning and seeing if there is a change in your sweat in that area.