Add yum repo to Sonatype Nexus Repository in Proxy mode

I tried to add it in yum repo list using:

[user9@zzzz-zzzzzz ~]$ cat /etc/yum.repos.d/nexus.repo
[CentosRepo]
name=CentosRepo
baseurl=http://<IP_OF_NEXUS>:8081/repository/CentosRepo/
enabled=1
#skip_if_unavailable=1
#gpgcheck=0
#sslverify=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

This is the way to test it ? because then i made a “sudo yum update” and i got:

failure: repodata/repomd.xml from CentosRepo: [Errno 256] No more mirrors to try.
http://<IP_OF_NEXUS>:8081/repository/CentosRepo/repodata/repomd.xml: [Errno 14] HTTP Error 500 - Internal Server Error