Polarized (sub)millimetre emission from dust grains in circumstellar disks was initially thought to be because of grains aligned with the magnetic field1,2. However, higher-resolution multi-wavelength observations3–5 and improved models6–10 found that this polarization is dominated by self-scattering at shorter wavelengths (for example, 870 µm) and by grains aligned with something other than magnetic fields at longer wavelengths (for example, 3 mm). Nevertheless, the polarization signal is expected to depend on the underlying substructure11–13, and observations until now have been unable to resolve polarization in multiple rings and gaps. HL Tau, a protoplanetary disk located 147.3 ± 0.5 pc away14, is the brightest class I or class II disk at millimetre–submillimetre wavelengths. Here we show deep, high-resolution polarization observations of HL Tau at 870 µm, resolving polarization in both the rings and