We examine a binary merger model for the formation of the mysterious triple-ring nebula surrounding Supernova 1987A, which still has not been convincingly explained in detailed hydrodynamical calculations. During the merger of 15 and 5 M-circle dot binary systems, mass is ejected primarily at mid-latitudes for a sufficiently evolved primary, as demonstrated by Morris & Podsiadlowski. This material is swept up by the fast wind of the central star during its post-merger blue supergiant phase, leading to a density contrast of similar to 150 in the outer rings at the time of the supernova. The equatorial ring probably formed later when the star contracted to become a blue supergiant. The asymmetry between the northern and southern outer rings can be explained by a 10 per cent asymmetry during the merger, perhaps due to a pulsational instability in the common envelope. We present a parameter study from which we determine a mass-loss rate in the blue supergiant wind in the range 1.5-3 x 10-7 M-circle dot yr-1 in agreement with previous estimates. The morphology of the best model is consistent with the well-known Hubble Space Telescope image at better than 5 per cent and is also in broad agreement with light-echo observations. The circumstellar environment on larger scales (up to 3 pc) is also investigated. We conclude with a brief discussion of the bipolar nebulae surrounding the Galactic stars, Sheridan 25, HD 168625 and eta Carinae.