Would the actual fireball have been visible from Shanghai?
Absolutely not. The bomb dropped on Nagasaki detonated at an altitude of about 1,500 feet. Nagasaki is roughly 505 miles from Shanghai, and only about one degree of latitude further north. Assuming the character was near sea level, there is no way he could have seen the blast.
A point 1,500 feet above the earth's surface is only visible from distances up to 47.5 miles away. That's less than 10% of the distance between Shanghai and Nagasaki.
Why? Because the earth isn't flat. It is an oblate spheroid. Here's a rough model to demonstrate the problem. It is not to scale, and the earth is shown as a sphere rather than an oblate spheroid, but the general idea is the same:
Would light reflected from, say, clouds in the stratosphere, be visible from Shanghai?
Nope. Assuming we're talking about a cloud some 33,000 feet above the earth's surface, it would only be visible from a distance of 222.7 miles away at most.
Would the mushroom cloud be visible from Shanghai?
No. The Nagasaki mushroom cloud was estimated to be 45,000 feet in height. This means it would be impossible to see from more than 260.1 miles away.
Would the blast wave reach Shanghai?
No, not in any strength that a human could detect. At a distance of less than 2.8 miles from the hypocenter (AKA, Ground Zero), the blast wave has already dropped to a pressure of less than 1 psi. Ambient atmospheric pressure at sea level is usually about 14.7 psi, so a person 500 miles from the hypocenter wouldn't feel or see any evidence of the blast wave.
Would any evidence of the explosion be visible from Shanghai?
Perhaps - you'd have to ask a physicist to answer this conclusively - but I doubt it.
Refraction might make some evidence of the bombing visible from distances greater than the calculations above would suggest, but this is unlikely for a couple of reasons:
The bomb was dropped over a valley, and the hypocenter is surrounded by mountains up to 1,400 feet tall (almost as high as the explosion itself). This makes refraction less likely.
The bomb wasn't dropped where it was supposed to be, because the military had decided to drop both bombs visually, which meant that they had to drop it in an area with clear skies. Much of Nagasaki - including the intended target - was covered with clouds that day. This cloud cover would diffuse light and reduce the likelihood of refraction.