WMS & WMTS
Why Your WMS Will Not Load in a Browser
A WMS that works in QGIS and fails in your web map is almost never broken. Mixed content, CORS, a user-agent rule, a GetCapabilities that answers with HTML, a WMTS URL in the WMS box: the short list of real causes, each with the symptom you see and the fix that works.
Read article