Hi. Do you have a photo of the nestbox or know the size of the hole?
There aren’t any foxes around here, but I did have one issue with a cat a couple of years back (investigating the hedgehog home doorway and trying to get inside).
I just bought a “cat resistant hedgehog tunnel” and attached it to the doorway in a way that made the cat (and the other 3 that visit) not want to bother trying to get in again (it would have had to do a reverse c shape to enter and then bend back around to the right to enter.
I suppose I could also have made one myself easy enough . .
Not sure how wily foxes are though . .