When would NSAIDS not be advisable and what is the underlying physiological reason why?

Considering deficits that certain patients might have, when would NSAIDS not be advisable and what is the underlying physiological reason why? Or why would some patients be candidates for surgery and why would others not?