The 20 year-old Lazio player picked up a knee injury in Wednesday’s 2014 World Cup qualification game against Namibia in Windhoek. The lad will be out for at least one month.
The game ended 1-1.
"I thought it was something I could manage when it happened but there was no point pushing myself to the extreme," Onazi told BBC Sport.
"Unfortunately, it means I will miss our Confederations Cup in Brazil."
He added: "I'm very disappointed because I always want to give my best for my country.
"Sometimes you face something like this to be stronger as a player. I can only wish my teammates well in Brazil."
Nigeria coach Stephen Keshi said that the team will miss Onazi who is an important past of the midfield.
"There's no denying the fact that we'll miss Onazi because he's an important player, he is the engine room of that midfield and this tells you how important he is to the team team,” said Keshi.