Let $D$ be a proper convex domain of $\mathbb C$ and $u : D \to \mathbb R$ be the function $$ u(z) = \inf \{|z - w| : w\in\mathrm{boundary}(D) \}. $$ Claim: $u$ is harmonic iff $D$ is an open half plane.
If $ D $ is an open halfplane, for example $ D= \{z : \Im z > 0\} $ then $ u(z)= u(x+iy) = y $ which is harmonic. It is similar in the case of other open half-planes.
The converse part I am not able to prove. If $ D $ is not an open half plane then $ u $ may not have partial derivatives at all; for example, if we take $D$ as first quadrant, then $ u(z) =\min\{x,y\}. $ How do I prove this?