I need help with the player collider

As you can see in picture 1 and 2 when my player looks up or down he goes out of the capsule collider and his head can go through objects and so does the camera because it follows the head. I really need help how to fix this.
Picture 1 : alt text

Picture 2 :
alt text

have a sphere collider attached to his head maybe, you should be able to attach it to his head or from looking at that image, it seems that you could attach it directly to the camera. However this may cause lots of issues when you stand upright. Im not 100 percent sure you can do it easily, unless you use maybe a mesh collider.