Chloro functional group is given number 4 in phenol but number 1 in nitrobenzene

In the IUPAC name 4-chlorophenol, we see that, the C atom where OH group is attached, is given number 1. But in the IUPAC name 1-chloro-4-nitrobenzene, we see that, the C atom where $NO\_2$ group is attached, is given number 4. In the first case, phenol is the base. So C atom of OH group of the base is given number 1. Applying the same rule to the second case, C atom of the $NO\_2$ group should be given number 1. Please help to clarify this point. Thanks.  

[![enter image description here](https://i.stack.imgur.com/mXOym.png)](https://i.stack.imgur.com/mXOym.png)


