Both near and nearby can be used as both an adjective and an adverb, so that’s why these terms are often confused.
Nearby means “close at hand,” both as an adjective and as an adverb. In both cases, the word can be used either before or after the word it modifies.
The gas flare can be seen from the nearby town. (adjective before modified word)
The gas flare can be seen from the town nearby. (adjective after modified word)
Locavores prefer to eat nearby grown foods. (adverb before modified word)
The toolpusher dwells nearby. (adverb after modified word)
The word near is far more interesting, because it can also be a verb and a preposition.
He gathered his courage to near the judge’s bench. (verb meaning “to approach”)
Please keep the stack of cups near the coffee pot. (preposition meaning “close to”)
Those are fairly straightforward; but let’s take a closer look at the adjective and adverb
Near kin, near and dear to my heart (closely related or intimate)
In the near future (close in time or distance)
Near miss, near beer (barely)
Keep your friends near and your enemies even closer.
She was near dead when the ambulance arrived.
OK, so knowing all that, let’s look at the following sentence and see which word should go there:
The company agreed to monitor air quality _____ the apartment complex.
What part of speech is needed? In this case it would be a preposition, as in the “near the coffee pot” example above. Other prepositions would fit here, such as around or in. Since nearby is not used as a preposition, you must use near here.
The company agreed to monitor air quality near the apartment complex.
Profound Quote of the Day:
“Slight not what’s near through aiming at what’s far.”
– Euripides, Greek poet, 480-406 BC