A colony of subterranean termites contains different castes such as workers and soldiers that perform various tasks. Foraging activity is vital among many tasks of a colony and ~20% of the worker population in a colony of Coptotermes formosanus engage in foraging. Although flexibility in task allocation plays a crucial role in maintaining colony function in fluctuating environments, such flexibility is barely understood in subterranean termites. Here, we investigated regulations of foraging task allocation in response to different soil types at the nest and the foraging site. At the nest and foraging site, either nitrogen-rich organic soil or nitrogen-poor sand, which differed in carbon and nitrogen ratio, was provided and the proportions of workers and soldiers at the foraging site were determined. Our results showed that the foraging worker proportion and per-capita wood consumption significantly differed depending on the soil type at the nest but not the soil type at the foraging site. When the colony had access to organic soil at the nest, the proportion of workers at the foraging site and per-capita wood consumption was much smaller than those with sand at the nest. Conversely, the proportion of soldiers at the foraging site remained the same regardless of the soil type at the nest and the foraging site. In brief, the current study showed flexible regulation of foraging task allocation in C. formosanus and demonstrated that perturbation of soil type alters the allocation of workers, but not soldiers, in the colony.