CHICAGO — Carmelo Anthony was back after a one-game absence with a migraine and Kristaps Porzingis returned to the player he was earlier this season.

Porzingis matched his career high with 29 points and grabbed 10 rebounds. It was his first double-double under interim coach Kurt Rambis and helped the Knicks to a rare road win against a team with a winning record.

The Knicks led by 22 and held off the Bulls to escape with a 115-107 victory Wednesday night at the United Center in the first of a home-and-home. They face off again Thursday night at the Garden.

“He seems to be alive again,” Rambis said. “He went through a period when it looked like his legs were dead. Now it looks like he got his second wind.”

Porzingis, who was more active than he has been in a long time, finished 11-for-15 from the field. His last double-double came Feb. 7, the day before Derek Fisher was fired. Porzingis had 18 of them while Fisher was the coach. He went 15 games under Rambis without one.

“I was feeling good physically,” Porzingis said. “I was able to knock down shots.”

advertisement | advertise on newsday

Anthony had 24 points as the Knicks (29-43) recorded their first road win over a team with a winning mark since beating Miami Jan. 6.

“He led us out there and we followed his lead,” Anthony said of Porzingis.

Nikola Mirotic hit nine three-pointers and scored a career-high 35 for the Bulls, who are 36-34 and fighting for a playoff spot.

The Knicks created separation in the third quarter. They shot 13-for-21 and outscored Chicago 35-18 to lead 92-73 heading to the fourth.

The lead grew to 101-79 with 9:17 remaining. The Knicks let the Bulls draw within 109-101 with 3:08 left. On the ensuing possession, Anthony connected on a tough three-pointer over Jimmy Butler just before the shot clock expired to put the Knicks up 11.

Knicks videos

Porzingis then fouled Mirotic attempting a three-pointer and he made the three foul shots with 2:17 left to make it 112-104. The Bulls never drew closer.

Anthony’s career trajectory could have been much different had he signed with the Bulls as a free agent two summers ago. But he said he doesn’t look back, and his loyalty to the Knicks shouldn’t be questioned.

Anthony stayed because the Knicks offered the most money, but he also never wanted to leave New York. He trusted that team president Phil Jackson would build a contender. You can’t blame Anthony if some of that trust has waned.

The Knicks are close to being eliminated from the playoffs for the third straight year. It’s led to speculation that Anthony might consider waiving his no-trade clause this offseason, depending on what Jackson does to upgrade the roster.

Anthony’s college coach, Syracuse’s Jim Boeheim, has said he thought his former player should have gone to the Bulls. Anthony said he told him as much.

advertisement | advertise on newsday

Boeheim said it again on ESPN radio Tuesday. But Boeheim added that Anthony wants to stay with the Knicks and should be praised for remaining committed to the team and the city.

“I know the reason why I stuck it out, and people that really understand know why I’m sticking it out,” Anthony said. “I think it’s odd to question loyalty at this point in time, especially when you show — and I’ve showed time and time again — my loyalty to not just the organization, but to New York and vice versa.

“So at this point I just go out there and play basketball. I try not to worry about it.”

This season has been extremely frustrating for Anthony, who had left knee surgery in February 2015. He’s changed his game, becoming more of a facilitator because he thought it would be better for his long-term health and for the team.

It worked early as the Knicks were a surprising 22-22 in late January. They’re 7-21 since.

advertisement | advertise on newsday

Anthony has made headlines, saying he thinks the Knicks should have a coaching search, said management has got to do something this offseason and “the ball’s in their court,” and he couldn’t guarantee he would be back next year.

“I don’t regret anything,” Anthony said. “Anything I said is always drama.”

Anthony’s drama is different from what his good friend LeBron James causes in Cleveland. James recently unfollowed the Cavaliers on Twitter. He gave a flimsy explanation, saying he did it to start mentally preparing for the playoffs.

“Their drama is more comical,” Anthony said. “Over here, it’s a different type of drama.”

But Anthony doesn’t think his migraine had anything to do with the drama or anything he’s experienced this season.

“If that was the case I’d have had migraines every day last year,” he said. “Last year was a lot worse than this year, just as far as winning 17 games and figuring out how to approach each day mentally.