Bisphosphonate, tetracycline and spironolactone use has been shown to increase gastro-oesophageal inflammation, an accepted risk factor for cancer. However, evidence of the effect of these medications on gastro-oesophageal cancer risk are mixed or missing entirely. Therefore, we conducted a nested case–control study using the Primary Care Clinical Information Unit Research (PCCIUR) database from Scotland. Cases with oesophageal or gastric cancer between 1999 and 2011 were matched to up to five controls based on age, gender, year of diagnosis and general practice. Medication use was ascertained using electronic prescribing records. Conditional logistic regression was used to calculate odds ratios (ORs) for the association between medication use and cancer risk after adjustment for comorbidities and other medication use. A similar proportion of gastro-oesophageal cancer cases received bisphosphonates (3.9% vs. 3.5%), tetracycline (6.0% vs. 6.0%) and spironolactone (1.4% vs. 1.1%) compared with the controls. The adjusted ORs for the association between gastro-oesophageal cancer and bisphosphonates, tetracycline and spironolactone were 1.05 (95% CI: 0.85, 1.31), 0.99 (95% CI: 0.84, 1.17) and 1.04 (95% CI: 0.73, 1.49). Further analysis revealed bisphosphonates were associated with increased oesophageal cancer risk (1.34, 95% CI: 1.03, 1.74) but reduced gastric cancer risk (0.71, 95% CI: 0.49, 1.03), although there was no obvious dose–response relationship. Overall, there is little evidence that the use of bisphosphonate, tetracycline or spironolactone is associated with increased risk of gastro-oesophageal cancer. Our findings should reassure GPs and patients that these widely-used medications are safe with respect to gastro-oesophageal cancer risk.