In conclusion, our results suggest that (1) treatment with DSS induced depression-like behavior and neuroinflammation in rats via alteration of gut microbiota, (2) supplementation with melatonin reversed depression-like behavior and neuroinflammation via increased SCFA producer and enhanced the integrity of BBB, and (3) administration with melatonin decreased the activation of FXR-FGF15 and ASK1 signaling pathways and contributed to improved metabolic disorder. This evidence concerns the gene NR1H4 and major depressive disorder.