New England Patriots free safety Devin McCourty, front, and his brother cornerback Jason McCourty, left, warm up during practice Wednesday, Jan. 9, 2019, in Foxborough, Mass. The Patriots are scheduled to host the Los Angeles Chargers in the AFC divisional round game, Sunday, Jan. 13, in Foxborough. (AP Photo/Steven Senne)

FOXBOROUGH, Mass.  — Patriots defensive end Trey Flowers says thinking about how to defend against the Los Angeles Chargers has kept him up at night.

“Over the bye I had a dream about not setting the edge,” Flowers said this week. “I woke up and it was a nightmare.”

New England’s leader this season with 7½ sacks, it was Flowers who gave opposing offenses fits as part of a defense that’s had its struggles but did just enough during the regular season to earn victories against some of the NFL’s top quarterbacks including Andrew Luck, Patrick Mahomes and Aaron Rodgers.

The Patriots’ next challenge is Chargers quarterback Philip Rivers , who will arrive in Foxborough on Sunday still looking for his first playoff victory (0-2) against New England and his first win over the Patriots with Tom Brady as the starting quarterback.

Rivers is 1-5 overall in regular-season meetings with New England, with his lone victory coming in 2008 when Brady was sidelined with a knee injury. He has yet to throw a touchdown pass against the Patriots in the postseason.

But Flowers said none of Rivers’ past shortcomings are evident when he dissects the 37-year-old quarterback on film.

“He’s definitely a veteran that’s been very successful over his career,” Flowers said. “I guess the experience just allows him to know that he can take over the offense, he can change things. It’s just one of those things where you’ve got to be aware that he can come in and take over.”

Patriots coach Bill Belichick said in that way the challenge of defending Rivers is not unlike the one Pittsburgh’s Ben Roethlisberger presents. Both are big presences in the pocket, giving them the ability to spot open receivers. Their size also makes them difficult to tackle.

“Makes good decisions with the ball, uses everybody — as he always does,” Belichick said.

That said, defenses have been able to get to Rivers with the pass rush this season. He was sacked 32 times during the regular season, up from 18 a year ago.

A perennial 4,000-yard passer, Rivers is among the NFL’s best quarterbacks at throwing the deep ball. But according to analysis done by Football Outsiders, the Patriots finished the regular season second only to the Chicago Bears at defending passes that travelled at least 16 yards in the air .

The Patriots also enter Sunday’s divisional round having forced eight turnovers in the final three games of the regular season.

Rookie cornerback J.C. Jackson was responsible for one of those turnovers, an interception against Buffalo. One of New England’s latest undrafted gems, he finished with three interceptions on the season. It’s helped fortify a veteran-led secondary that’s made things difficult for opposing quarterbacks.

Safety Duron Harmon leads the Patriots with four interceptions. First-team All-Pro Stephon Gilmore has two picks on the season.

Jackson says he’s looking forward to his first bite of playoff football.

“Of course, I’m nervous — this is my first playoff game,” he said. “I’m nervous, but I’m ready. It’s a ready nervous.”

While New England’s defensive personnel has changed over the years, Rivers said the Patriots have consistently made things difficult on him over the years.

“The ability for them to be very multiple and do things very well and really you see how … they do of trying to take away what you do best,” he said.

Rivers may have to throw the ball even more this week with running back Melvin Gordon dealing with a knee injury he sustained during last week’s wild-card win over the Ravens.

Gordon helped take a lot of pressure off Rivers during the regular season. In 12 games, he rushed for 885 yards and 10 touchdowns, while also catching four scores out of the backfield. His 5.1 yards per rushing attempt average was also key in helping Rivers and offense sustain drives.

Gordon rushed 17 times for 40 yards and a touchdown against Baltimore.

Chargers coach Anthony Lynn rested Gordon at practice on Wednesday and acknowledged he likely wouldn’t be 100 percent by Sunday.

Harmon said he is expecting Rivers’ best, whoever is in the huddle with him. He said he’s not trying to overthink the challenge.

“Just try to make it hard on him,” Harmon said. “Give him different looks. Try to make him play that game with us and hopefully we can win that mind game against him.”