It is not due to a hernia.
Your symptoms are suggestive of;
1) Iliopsoas tendinitis
2) Pinched nerves in back
3) Osteitis pubis
Chronic groin and scrotal pain is usually related to noninflammatory conditions but chronic infections also should be considered. Because the testes arise embryologically in close proximity to the kidneys, pain arising in the kidneys or retroperitoneum may also be referred to as the groin and testes. So an abdominal ultrasound, intravenous pyelography, and a CT scan of the abdomen also should be done to evaluate this pain.
A urine and sperm culture for pyogenic organisms and mycobacterium should be done. This should be able to point toward the chronic infection and give the guidelines for further management.
Following are the other causes to be considered for the pain are;
1) Recurrent torsion
2) Torsion or inflammation of the appendix of the testes
3) Infectious epididymitis
4) Noninfectious epididymitis; occur due to reflux of urine through the ejaculatory ducts and vas into the epididymis, producing a "chemical" inflammation
5) Referred pain - the genitofemoral, ilioinguinal, or posterior scrotal nerves CAN CAUSE REFERRED PAIN. Other causes of referred pain are abdominal aortic aneurysm, ureteric stone, lower lumbar or sacral nerve root impingement, retrocecal appendicitis, retroperitoneal tumor, and postherniorrhaphy pain.
I hope your symptoms resolve soon.
I would be happy to assist you further if you need any more information.
Thanks for using JustAnswer.