Nearby gamma-ray bursts (GRBs) are likely to have represented a significant threat to life on the Earth. Recent observations suggest that a significant source of such bursts is compact binary mergers in globular clusters. This link between globular clusters and GRBs offers the possibility to find time intervals in the past with higher probabilities of a nearby burst, by tracing globular cluster orbits back in time. Here we show that the expected flux from such bursts is not flat over the past 550 Myr but rather exhibits three broad peaks, at 70, 180 and 340 Myr ago. The main source for nearby GRBs for all three time intervals is the globular cluster 47 Tuc, a consequence of its large mass and high stellar encounter rate, as well as the fact that it is one of the globular clusters which comes quite close to the Sun. Mass extinction events indeed coincide with all three time intervals found in this study, although a chance coincidence is quite likely. Nevertheless, the identified time intervals can be used as a guide to search for specific signatures of GRBs in the geological record around these times.