Local optical spectroscopy of semiconductor nanostructures in the linear regime