For Pad 40, the best spot for Falcon 9 launches when available is the LC-39 Observation Gantry, at just 3.4 miles away, via tickets sold through the KSC Visitor Complex. Playalinda Beach (6.3 miles at fence if allowed, 7.2 at parking lot one, at least partially obstructed views in most places) and the Saturn V Center (also 6.3 miles but clear view) are also options.
The Visitor Complex itself is 6.7 miles from the pad but offers no view of the pad itself (obscured by the tree line).
Port Canaveral's Route 528 (11.6 miles) is the closest and best spot otherwise, and the best place to go for off-hours launches. The Port area is also best if the launch includes a first-stage landing. The same goes for watching from Jetty Park pier and beach.