That's the raison d'être of nginx, so it is performant for this kind of thing. However, the advantage of a CDN is that they have points of presence around the world, so your user in Singapore doesn't have to do a trip around the world to get to your nginx on a physical box in Lisbon.
The "trick" has really been known for a decade, or more. Have as many things static as possible, and only use backend logic for the barest minimum.