This paper studies a general model of matching with constraints. Observing that a stable matching typically does not exist, we focus on feasible, individually rational, and fair matchings. We characterize such matchings by fixed points of a certain function. Building on this result, we characterize the class of constraints on individual schools under which there exists a student-optimal fair matching (SOFM), the matching that is the most preferred by every student among those satisfying the three desirable properties. We study the numerical relevance of our theory using data on government-organized daycare allocation.