First, oftentimes nail fungus can be an outward manifesting symptom of candidiasis (overpopulation of candida albicans). Candidiasis is very common, a product of rampant overuse of prescription drugs, particularly antibiotics. Antibiotics kill off all bacteria in the gut, the beneficial intestinal microflora included, and this encourages candida to overpopulate. Once candida gets overpopulated, it goes systemic (throughout your body) and behaves like a fungus.
From there, the candida roots itself into the gut lining and/or vascular linings. This forms myriad holes in the gut and bloodstream and further perpetuates the systemic spread of the candida. This leads to a condition called leaky-gut syndrome. You can tell by the name alone that it's a good one to avoid.
Ways to tell if you may have candidiasis are intense sugar cravings, consistent foggy-headedness, white coating on tongue, itchiness in warm and moist parts of your body (jock itch or athletes foot), recurring yeast infection, belly bloat, and constipation. If you have some or all of these symptoms, it is a good likelihood you have candidiasis.
Improvements to diet are usually necessary to rebalance. Massive reduction of refined carbohydrates and refined sugar are the most important steps. I can't stress this enough. American agricultural practices store grains in huge silos and vats. This is a total fungus factory. Bugs, fungus, mold, and rodent feces are present in huge quantities in most commodity grain crops. It doesn't take a degree to figure out that is a recipe for ill health. Refined sugar is pretty much poisonous. I would greatly encourage everyone to massively reduce their intake of refined sugars and artificial sweeteners.
At the same time you reduce your consumption of refined grains and refined sugars, start eating more high fiber vegetables, cultured foods, and taking a high potency (10 billion organisms or more) probiotic. The fiber will help to flush dead and dying candida from the gut while the probiotics will rebalance the dysbiosis (imbalance of beneficial flora to non-beneficial flora).
I would also encourage you to consume herbs known to reduce candida. Some of my favorite choices are garlic, pau d'arco, and olive leaf. These anti-fungal herbs will help to actively lower the levels of candida while the probiotics and cultured foods (yogurt, kefir, sauerkraut, kim-chi, natto, miso) increase the beneficial flora. Follow the recommended directions on the product. As always, make sure to get a high quality version of the herbs. Kyolic, New Chapter, and Natural Factors make good garlic, Gaia herbs and Herb Pharm make great pau d'arco, and Seagate and Blue Bonnet make good olive leaf.
If you go with the garlic option, you can also eat fresh garlic. It tastes incredibly strong, but the allicin content in raw garlic is powerful at reducing fungus levels in your body. Roasted garlic tastes better but isn't very potent for fungus.
An alternative to the herbal approach to lowering candida levels is an enzyme-based approach. This would involve taking a product like Candidase from Enzymedica or Candex from Pure Essence Labs. Both are fantastic for quick (although a bit more expensive in the short term), comprehensive results.
For additional benefit, apply a good quality tea tree oil or neem seed oil to the nail bed. After doing so, cover the area with a sock. The warmth will increase the absorption into the skin and nail bed and it will also slow the evaporation. Tea tree oil drys really quickly if left exposed. It'll still work but it will take more frequent application.
Plan on applying the tea tree oil or neem seed oil at least twice a day. Apply with a cotton swab, like a Q-tip, first thing in the morning and last at night. Plan on doing this for 3-6 months. You may get good results sooner, but it is safer to plan for the long haul.