I had a very nasty (disgusting looking as well) nail infection in my big toe and the doctors prescribed antibiotics for 6 months which after only 3 days started causing side effects and other problems. After a lot of research (thanks google) I used 2 methods just to be sure.
Everyday, after shower I would spray a premixed solution of Himalayan salt (sea salt is also an option that might work also), 1 tablespoon in 100ml, and let it dry naturally.
Also, 2 times a day I would put some coconut oil all around the nail with a cotton bud making sure that it goes under the nail and in between the skin and the nail all around. The soreness and pain disappeared in a week and the infected nail grew out naturally in a few months.
Thanks to Mother Earth. Coconut oil is also good for many other skin problems.