The US has closed off towns before
Adapt the model used for Hanford during the Manhattan Project. Or maybe you model it after Centralia, which was condemned in the 1990s due to coal fires in the mines that had been burning since the 1960s (if that doesn't evoke a similar feel to what you're going for...)
Early on, your job is easy
Most roads of any real distance were privately owned turnpikes during the late 1700s and early 1800s. Until the 1890s.
The Office of Road Inquiry (ORI) within the Department of Agriculture was established in 1893, headed by Civil War hero General Roy Stone. It had a budget of $10,000 to promote new rural road development, which at that time were mostly dirt roads. Source
So it would be a trivial task to wash out a bridge or two, spread some rumors of fire, Indian attacks, or disease in nearby towns to discourage curiosity, and then quietly station guards on logical routes into your town to prevent exiting or entering the area.
It would be easier if your town is mountainous, since that naturally limits the entry points and makes it easier to choke those off from explorers.
But it will get harder
As your timeline progresses, the task will get harder. The advent of the Model T encouraged driving, which encouraged better, paved, roads, which encouraged more driving. Population pressure encouraged settlers to stretch out. Towns grew. Farms reclaimed land. If you're in the US and east of the Mississippi River, there's really no where to hide a town except in the most difficult to reach mountain passes of the Smokey Mntns. Anything else has enough people by WWI that they'd have probably have found your community.
By WWI and WWII, the threat of disease or curse or whatever will no longer deter anyone. So you're left with a few hard-to-reach corners of the mountains or out west. Alaska, of course. Or the Rocky Mountain region. Or the southwest desert. Inhospitable areas with low population density.
Flight ramps it up even more
With the advent of reliable commercial flight, your odds of hiding a town shrink to infinitesimal odds. I've met professional pilot/photographers who go door to door selling aerial photos of properties. Once a pilot can fly anywhere they want, eventually someone would notice. Then they'd wonder why the town isn't on their maps.
Sure, you can route federal and even state highways around a dead zone. But you can't stop flyovers. So now you're talking about somehow creating no-fly zones but also not increasing curiosity because of those zones. Tricky stuff.
I guess you could build a military base around your town's borders. Many bases are large enough to hide a small town. And they are usually no-fly zones for security reasons. Anyone on post might get curious, but a fence with a guard who requires anyone who enters to have specific security clearances will stop the curious in their tracks. Plus now there's a military presence in case of problems from the town.
Commercial satellite imagery is the end
Once you have Google Maps, there's no way to prevent someone from seeing evidence of your town. I mean, I guess you could disguise the roofs, but that's pretty difficult. And if your town has been cut off since the 1800s, the odds are the residents are all basically Amish in technology and wouldn't have any understanding as to why they should plant grass on their roofs, somehow hide any chimneys, and take care not to have roads or paths between buildings.