Your ex boyfriend may not be entirely over the relationship and how it all ended back then.
He may feel somewhat awkward and worries that if he were to talk to you, all of the emotions that he never really dealt with will completely resurface and consequently overwhelm him.
If you don’t need to talk to him to do your job, it may be best to just mind your own business and avoid approaching him.
He is your boss and thereby influential. He is probably not a person that you would want to risk upsetting.
Now, if the both of you happen to bump into each other in a hallway, at the elevator or the break room, you can be polite and professional in greeting him.
However, leave it at that.
In time, if he reaches a point where he feels like he would like to talk with you, he will.