The expression "close to," has to have an object.
"Oh, you live in Beijing, do you? I live close to you (you is the object)."
"Oh you live in Beijing do you? I live close by." With 'close by,' then "near you," is the meaning.
As you will see from the above "close by," does not require an object.
"Close to," is widely used to describe where one thing is located compared to another:
"The church is close to the school."
"Close by," is not really used in these situations.