Primarily from the sinuses. The sinus cavities are huge (in comparison to the size of the normal skull) (see here:
http://img.tfd.com/do...cha_nasi-inferior.jpg ) and their entire purpose is to produce mucous to keep the membranes moist and collect things introduced from the environment.
Thing is, they're also a fertile breeding ground for bacteria and viruses, seeing as they are warm and wet. The bacteria is maintained under control by the oxygen breathed in but some times swelling will occur and trap off a small portion of the sinus cavity and not allow introduction of O2 and the bacteria present "blooms", et voila... snot happens... and buckets of it. That's almost the singular reason a cold introduces itself with a sore throat, from the bacteria loaded mucous draining down the back of the throat from the sinuses (although a true "cold" is a viral infection and one variety which you'll never catch again. If you could live long enough to catch all 265 (estimated) cold viruses you'd never catch cold again).
Color... my well worn copy of "Childhood Diseases" says this: "...The green or yellow color of snot is usually caused by certain helpers that your body uses to fight off viruses or bacteria. The name for these infection-fighting helpers is “neutrophils,” and it’s the iron in a special enzyme used by the neutrophils to fight off your germs that is usually the source of your snot’s weird, gross color!
The color of your snot does not necessarily indicate how sick you are – really green snot doesn’t necessarily mean you’re really sick, and clear snot doesn’t necessarily mean you aren’t sick..."
Thanks for the query... I've wanted to expound on this for a coon's age...