Yeah, doing that can cause temp spikes due to your snake moving around, peeing on it ect etc. It should be between your UTH and your enclosure. There's a diagram I'll post it if I can find it.
Unless you're using overhead heating, than it should be within 5 in of your heat source.