Chronic inflammation of the intestine is detrimental to mammals. Similarly, constant activation of the immune response in the gut by the endogenous flora is suspected to be harmful to
Drosophila
. Therefore, the innate immune response in the gut of
Drosophila melanogaster
is tightly balanced to simultaneously prevent infections by pathogenic microorganisms and tolerate the endogenous flora. Here we describe the role of the
big bang
(
bbg
) gene, encoding multiple membrane-associated PDZ (PSD-95, Discs-large, ZO-1) domain-containing protein isoforms, in the modulation of the gut immune response. We show that in the adult
Drosophila
midgut, BBG is present at the level of the septate junctions, on the apical side of the enterocytes. In the absence of BBG, these junctions become loose, enabling the intestinal flora to trigger a constitutive activation of the anterior midgut immune response. This chronic epithelial inflammation leads to a reduced lifespan of
bbg
mutant flies. Clearing the commensal flora by antibiotics prevents the abnormal activation of the gut immune response and restores a normal lifespan. We now provide genetic evidence that
Drosophila
septate junctions are part of the gut immune barrier, a function that is evolutionarily conserved in mammals. Collectively, our data suggest that septate junctions are required to maintain the subtle balance between immune tolerance and immune response in the
Drosophila
gut, which represents a powerful model to study inflammatory bowel diseases.