The invention discloses a nanoemulsion compound transdermal spray for treating chronic gastritis and gastric ulcer. The nanoemulsion compound transdermal spray is prepared from the following raw materials in percentage by mass: 35-45% of surfactant, 0.5-2% of auxiliary surfactant, 2-6% of fructus amomi oil, 1-4% of patchouli oil, 2-6% of cinnamon oil, 1-4% of atractylis oil, 1-3% of dried tangerine peel oil, 0.2-1% of azone and the balance of deionized water, wherein the sum of the mass percentages of the raw materials is 100%. The compound transdermal spray has rapid and durable pain alleviating action, has the effects of warming stomach and alleviating pain, warming spleen and promoting qi flow, eliminating inflammation and promoting tissue regeneration, improving microcirculation, promoting ulcer healing and the like, and is nontoxic and harmless to human bodies. The compound transdermal spray is applied to skin above navel and can be absorbed through massaging, has aromatic flavor, and does not pollute clothes, thereby greatly improving patient compliance.