The French club received special permission from the league to appoint the Italian, as he exceeded the age limit of 65 for managers.
Ranieri lead the unfashionable Foxes to the Premier League title in 2015-16, defying the odds along the way in a fairytale campaign.
But he was fired back in February, amid rumours of a player rebellion as the club struggled near the foot of the table.
Ranieri takes over from Sergio Conceicao after the former Portugal international left for Porto.
Conceicao, 42, guided Nantes to seventh place in Ligue 1 last season.
Ranieri has previously managed in France, guiding Monaco to promotion to Ligue 1 in 2012-13 before seeing them finish second in the table the following season.
It will be Ranieri's 17th managerial job in a career that has spanned more than three decades, and seen him manage the likes of Inter Milan, Juventus, Roma, Atletico Madrid, Chelsea and Valencia twice.
His Premier League title with Leicester is his only top-flight title during that time.
Nantes have won the Ligue 1 crown a total of eight times, the last time being in 2001.