As long as it passes through PageSpeed at least once, you will benefit from the optimization.
The flow is essentially the same, with a different order:
User <--- NGINX <--- PageSpeed <--- Apache
User <--- PageSpeed <--- NGINX <--- Apache
Some factors that could potentially sway your decision are:
- Has Apache been configured to use more resources, or has NGINX?
If one application has it's resources limited, and is placed under heavy load while also trying to call PageSpeed, it might have its performance impacted.
If you have specifically configured one application to be a heavier user of the system resources, you might want to attach PageSpeed's function to that application, so that it has more space to do processing and so on.