diff --git a/packages/nuxt-module/plugins/domain.js b/packages/nuxt-module/plugins/domain.js index 7128bb2e3..4c58c806b 100644 --- a/packages/nuxt-module/plugins/domain.js +++ b/packages/nuxt-module/plugins/domain.js @@ -48,7 +48,7 @@ export default async ({ app, route, req }, inject) => { if (process.client) { hostname = window.location.hostname; pathname = window.location.pathname; - } else { + } else if (!process.static) { const detectedHost = req.headers["x-forwarded-host"] || req.headers.host; hostname = Array.isArray(detectedHost) ? detectedHost[0] : detectedHost;