Helicobacter pylori is a recognized causal factor of noncardia gastric cancer (GC). Lipopolysaccharide and peptidoglycan of this bacterium are recognized by CD14, TLR4 and NOD2 human proteins, while NFKB1 activates the transcription of pro-inflammatory cytokines to elicit an immune response. Single nucleotide polymorphisms (SNPs) in these genes have been associated with GC in different populations. We genotyped 30 SNPs of these genes, in 365 gastric adenocarcinomas and 1,284 matched controls from the European Prospective Investigation into Cancer cohort. The association with GC and its histological and anatomical subtypes was analyzed by logistic regression and corrected for multiple comparisons. Using a log-additive model, we found a significant association between SNPs in CD14, NOD2 and TLR4 with GC risk. However, after applying the multiple comparisons tests only the NOD2 region remained significant (p=0.009). Analysis according to anatomical subtypes revealed NOD2 and NFKB1 SNPs associated with noncardia GC and CD14 SNPs associated with cardia GC, while analysis according to histological subtypes showed that CD14 was associated with intestinal but not diffuse GC. The multiple comparisons tests confirmed the association of NOD2 with noncardia GC (p=0.0003) and CD14 with cardia GC (p=0.01). Haplotype analysis was in agreement with single SNP results for NOD2 and CD14 genes. From these results, we conclude that genetic variation in NOD2 associates with noncardia GC while variation in CD14 is associated with cardia GC. What's new? Variations in immune genes appear to play an important role in determining susceptibility to gastric cancer linked to Helicobacter pylori colonization of gastric mucosa. However, little is known about the influence of variation on anatomical localization and histological subtype of this malignancy. The results of this study first confirm that NOD2 and CD14, which encode proteins that recognize H. pylori lipopolysaccharide and peptidoglycan, are significantly associated with gastric cancer risk and second indicate that NOD2 associates with noncardia and CD14 with cardia gastric cancer. The differential effects of variation on the anatomical localization of disease warrant further investigation.