Non-linear electrodynamics in curved backgrounds