The 35-year-old has struggled for first-team action this season, mainly because of the form of Kyle Naughton at right-back, but his absence comes as a setback nonetheless.
The Swans will need all hands on deck as they bid to stay away from the relegation zone, and the Spaniard will be missing for some crucial games.
“Swansea City skipper Angel Rangel is expected to return to first-team training in six weeks following successful surgery,” said a statement on the official club website.
“The Spaniard went under the knife in London on Monday to cure a groin problem, and he is set to play a part in the club’s Premier League run-in after the successful procedure.”
Uwe Rosler was sacked by Fleetwood following a 3-0 reverse at Doncaster which condemned Town to a seventh straight defeat in all competitions.
Cambridge interim head coach Joe Dunne was pleased with how his side adapted to beat Grimsby 3-1.