The 26-year-old confirmed he has ostesarcoma, which will require an operation in the coming weeks where a part of the bone will be removed.
Left-back Anderton joined Rovers in 2021 and played a crucial role in the club's dramatic promotion to League One on the final day of last season following a five-goal swing over Northampton after a 7-0 thrashing of Scunthorpe.
"Unfortunately I've been diagnosed with osteosarcoma," he said.
"This is a rare form of cancer that is affecting my femur. I'll be undergoing an operation to remove this part of the bone in the coming weeks.
"This diagnosis has come as a huge shock to both myself and my family, however we are remaining positive and hopeful.
"I want to thank everyone at Bristol Rovers, especially club doctor Ian Ferguson and head of medical Stuart Leake, the specialists at the Royal Orthopaedic Hospital in Birmingham and my family for their continued support.
"I want to wish the boys all the best for the upcoming season, starting this Saturday back at The Mem. Hopefully I can be swinging off another traffic light on Gloucester Road come May!"
Bristol Rovers host fellow promoted outfit Forest Green on Saturday.
Chief executive Tom Gorringe added: "Everyone at Bristol Rovers shares our sympathies for Nick at this difficult time and we will do everything possible to help support Nick and his family during his recovery.
"I am sure everyone will want to show their support for Nick, which will help him immensely as he recovers. I would also ask that everyone shows respect for his and his family's privacy during this time."