ATHENS — Terminal E2 in Piraeus, the port city near Athens, is typically a cheerful holding spot for tourists waiting to board ferries for sunny Greek island vacations. But on a recent day, nearly 1,000 exhausted migrants who had just crossed the Aegean Sea from Turkey sprawled across the sweat-soaked floor and on the asphalt outside, waiting to hear if they could continue toward Germany.

The answer came soon enough: Syrians and Iraqis could board buses for Greece’s northern frontier with Macedonia, which was already choked with nearly 10,000 migrants after Macedonia sealed its border over the weekend. Everyone else — including Afghans, who made up the bulk of the crowd — would be shuttled to one of a rapidly growing number of refugee camps being set up around Athens.

With thousands of migrants still arriving each day, and thousands more being turned away from Greece’s northern border, the rough outskirts of Athens, Piraeus and the northern city of Thessaloniki near the frontier are becoming the new hot spots to hold them. Camps have been opening at the rate of nearly one a day, including at Greece’s dilapidated former Olympic Stadium and in mothballed military bases, to house more than 25,000 people who cannot move forward because of the new border restrictions and because they cannot or will not turn back.