Prime Minister Mehdi Bazargan today announced a Cabinet reshuffle, appointing Iran's first minister of oil to replace controversial oil company chief Hassan Nazih in a move that raised fears of major oil industry upheavals.

The reshuffle followed a week of intensifying attacks on Hazih by members of the Moslem clergy hostile to his liberal views and blunt criticism of Iran's present leadership.

The removal of Nazih, who had become popular with many oil industry workers and was instrumental in restoring normal operations in the southern oil-producing region after the Iranian revolution, threatened to spark renewed unrest in that vital industry.

In recent days, technocrats in the National Iranian Oil Co. which Nazih headed went on strike briefly to protest attacks on him by Iranian clergymen. A renewal of strikes by Iran's dwindling number of trained managers could seriously disrupt the oil industry and possibly lead to production cuts such as those which cripped the government of Shah Mohammed Reza Pahlavi last winter, observers said.

Nazih's dismissal represents another defeat at the hands of the ruling clergy for Bazargan, who strongly defended Nazih earlier in the week.

The announcement of today's Cabinet reshuffle made it plain, however, that Bazargan was not giving up office.

The head of the newly created Oil Ministry is to be Ali Akbar Moinfar, previously in charge of the Plan and Budget Organization. His responsibilities will include the petrochemical and gas industries as well as well as the National Iranian Oil Co.

As part of today's reshuffle, Bazargan appointed Deputy Prime Minister Mostafa Ali Chamran as defense minister, replacing Gen. Taher Riahi. Gen. Riahi resigned two weeks ago on grounds of ill health and promptly moved to France.

Chamran, closely associated with the Lebanese Shiite Amol group, played a much publicized role in recent operations against Kurdish insurgents and is already chief of the National Information and Security Agency set up to take the place of shah's secret police, SAVAK.

The other Cabinet change was the removal of Dariush Foruhar from the sensitive post of minister of labor to become a roving minister without portfolio with duties not yet explained.

There was no uncertainty, howver, about the fate of Nazih, whose dismissal was not referred to by the prime minister but was confirmed by other members of the Cabinet.

Earlier in the day, the prosecutor general of the Islamic revolution, Ali Qoddusi, issued a summons for Nazih to appear at his office within 24 hours to answer unspecified charges against him.

The charges are believed to be those filed by a Justice Ministry official earlier this week accusing him of attacks on Islam; being disrespectful of Ayatollah Ruhollah Khomeini belittling Iran's de factor ruler; the Revolutionary Court and providing financial assistance for Ayandegan, the now-banned independent daily newspaper, after Ayatollah Khomeini had indicated his disapproval.

The main issues raised against Nazih in the last week, however, have been his running of the oil industry, in which he has been charged by the clergy with being the source of labor unrest.

In a speech broadcast by the official Iran Radio today, Ayatollah Khomeini warned that Nazih may stand trial for treason.

"If there is any treason detected against the nation and Islam, there is a court and Nazih will be tried," the ayatollah repeatedly stressed.

He said he had already been informed of the situation in the oil industry by his son-in-law and special representative, Hojatoleslam Sahab Eshraghi, who accused Nazih last week of being insufficiently revolutionary, refusing to comply with worker demands for a purge of the oil industry and widening the pay and social benefit gaps between white- and blue-collar workers.