  In this paper we analyze the thermodynamic properties of a photon gas under
the influence of a background electromagnetic field in the context of any
nonlinear electrodynamics. Neglecting the self-interaction of photons, we
obtain a general expression for the grand canonical potential. Particularizing
for the case when the background field is uniform, we determine the pressure
and the energy density for the photon gas. Although the pressure and the energy
density change when compared with the standard case, the relationship between
them remains unaltered, namely $\rho=3p$. Finally, we apply the developed
formulation to the cases of Heisenberg-Euler and Born-Infeld nonlinear
electrodynamics. For the Heisenberg-Euler case, we show that our formalism
recover the results obtained with the $2$-loop thermal effective action
approach.
