I believe the portrait inside is not that of a common soldier, nor that of King Frederick VII of Denmark whose monogram appears on the coin itself, but of his cousin and successor,
Christian IX; there are two pics of him currently in his Wikipedia article which show him wearing much the same uniform and set of medals; the second pic is "retouched" from an original that dates from 1864 and seems to be an exact match for the one in the coin:

1863 was the year Frederick VII died and Christian IX became king. The coin would have been relatively new when it was made into a locket.
Don't say "infinitely" when you mean "very"; otherwise, you'll have no word left when you want to talk about something really infinite. - C. S. Lewis