First, Nikon uses Sony image sensors, which outperform the sensors that Canon makes for itself. (FYI, Pentax and Sony also use Sony sensors.)
Second, my preference is to look for the best, most affordable lenses for the intended subject, and just get the best, most affordable body for those lenses. So...
- Night Photography - Large apertures (numerically low f-numbers.)
- Portraits - Also large apertures, focal lengths from 57 mm (35mm equivalent focal length of 85 mm) to 90 mm (35mm equivalent of 135 mm.) (These are generally accepted as the best focal lengths for portraiture, as they provide a flattering perspective.)
- Flower Photography - Close focusing, not really 'Macro', but close. Magnification ratios approaching 1:2.
- Landscape - Wide angles of view/short focal lengths with low chromatic aberration, low vignetting, and low field curvature. If this also means Cityscapes, then low distortion also.
(BTW, if you haven't figured it out by now, you should know that you're going to spend a lot more on lenses than you will on the camera.)
Generally speaking, for large apertures, you will most likely stick to fixed focal length lenses (primes). Zoom lenses are generally limited to maximum apertures of f/2.8 or smaller, though there are exceptions. Sigma has a 17-70 mm f/2.8-4.0 that is reasonably priced, performs quite well, has its own AF motor, and is optically stabilized. It also has a magnification ratio of 1:2.8. That one lens could do the majority of what you say you need. If you need a lens with a larger aperture, there's the 18-35/1.8, which costs more than the 17-70 but less than a collection of primes covering the same range. (Sigma Lenses are available for either Canon or Nikon cameras.) If you don't want a zoom, there are primes with large apertures that may even provide better image quality, but a collection of primes to cover your goals will likely cost more.
You should know that the kit 18-55 mm f/3.5-5.6 lens that often comes with a camera body, would not be very good for any of the types of photography you say you want to do, so you should look for a 'Body-only' purchasing option.
Unfortunately, we've just shot past your $500 goal. The Sigma 17-70 is `$400 all by itself, and the least expensive Nikon 'Body-only' dSLR is ~$650, but without the proper lens(es), a body with the kit lens wouldn't be much use to you.