On most cameras, half-pressing and holding the shutter release will lock both the focus and the exposure so that you can reframe the shot but keep those settings locked.
Not on Nikon DSLRs. Half-pressing and holding the shutter button only locks the focus – the camera will keep adjusting the exposure as you change the framing of the picture.
If you want to lock both at the same time, you need to press and hold the AE-L/AF-L button on the back of the camera with your thumb – AE-L will light up in the viewfinder.
You can change the behaviour of both the shutter release and the AE-L/AF-L button using the Custom Settings menu, but it’s usually enough to be aware of which button does what.