The main ideas and methods currently used to obtain upper limits on the photon rest mass from astrophysical data are briefly reviewed. One method is based on the fact that if the photon has nonzero rest mass m magnetoacoustic waves cannot have frequencies lower than a certain critical frequency, which depends on m. If wisps in the Crab Nebula are interpreted as magnetoacoustic waves of extremely low frequency, then the data of many-year observations of the wisps put an upper limit on m which is much better than the one established under terrestrial conditions. An error is pointed out in a different method which has been proposed in the literature in which the contribution of the energy of the galactic magnetic field (or rather, the vector potential) to the mass of Galaxy is estimated on the basis of gravitational effects. The point is that in the general theory of relativity not only energy but also pressure has a weight. In the case under consideration, these two contributions cancel each other and the galactic magnetic field cannot produce anomalously strong gravitational fields. The most stringent upper limit on the photon rest mass, m≲ 3·10-60 g, is obtained from the analysis of the mechanical stability of magnetized gas in the galaxies with allowance for the specific pressure forces of the vector potential. This upper limit is 12 orders of magnitude better than the best upper limits obtained under terrestrial conditions. This result clearly demonstrates the effectiveness of astrophysical methods.