But after two visitors from Wuhan, the epicenter of the new outbreak, were hospitalized in Japan for coronavirus infections over the past week, nerves have been on edge.

This month, a shop owner in Hakone, a popular hot-springs resort town, posted a sign reading, “Chinese are not allowed to enter the store.” A photo of it was widely shared on social media in both Japan and China, and some began to wonder if the new coronavirus would amplify an anti-Chinese undercurrent that persists in Japan.

Others applauded the shop owner’s move, saying that Chinese tourists often exhibited “bad manners,” a common theme in online complaints and news reports.

Masanari Iida, a former candidate for public office in Kanagawa Prefecture, argued on Twitter that the owner was acting in “self-defense.”

“I don’t understand why this is a problem,” Mr. Iida wrote. “The store has a right to choose its customers.”

Fears have spiraled across Asia as China reported that the virus has caused at least 41 deaths and sickened nearly 1,300 people. The Chinese government has put a dozen cities in the central part of the country on a travel lockdown, effectively corralling 35 million residents.

The Japanese prime minister, Shinzo Abe, said on Friday that Japan would increase efforts to quarantine visitors who showed symptoms of the coronavirus. The government also recommended that Japanese citizens refrain from visiting Wuhan for “unnecessary or nonurgent trips.”