This works for a lot of back issues but not all of em! For example syringomyelia, depending on where it forms, can be exacerbated by working out. So ideally make sure you have a good idea of why your back hurts before you start, but it can be hard to diagnose.
https://asap.org/disorders/articles/exercise-concepts/