Both. Wikipedia and Japan Today have some interesting information on the history of the two pronunciations: https://en.wikipedia.org/wiki/Names_of_Japan and https://japantoday.com/category/features/nippon-or-nihon-no-consensus-on-japanese-pronunciation-of-japan