Hi ! From your history, it seems that you have got a chronic infection of the epididymis
( which is attached to the testis ) along with possible orchitis. Due to the chronic infection, possibly the epididymis has got enlarged and gives you aches whenever it gets hit with your inner thigh. The associated orchitis also may be partly responsible for the pain. You should go for a routine urine test along with a culture sensitivity test if advised by your treating doctor. This is due to the fact that chronic urinary tract infection
may also lead to associated epididymo-orchitis
. You may have to take appropriate antibiotics, along with anti inflammatory drugs and use a proper scrotal support. If it does not get relived, then your doctor may ask you to under go a doppler ultrasound
of both the testes to exclude any other pathology of the testes. Wish you an early recovery. Thanks.