You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently have my basePath, assetsStaticBasePath, and assetPrefix values in next.config.js set so that my static assets (ie. images) load when the site is accessed via https://customdomain.com/mysite. Static assets fail to load if the user visits https://mysitehost.customdomain.com/ directly.
I would like static assets to load properly via both entry points. To do this, I need to get the current domain in next.config.js.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I have a site that is accessible via both a top level domain through a folder path (ie. https://customdomain.com/mysite) and via a subdomain (ie. https://mysitehost.customdomain.com/). The top level domain reverse proxies requests that it receives to https://mysitehost.customdomain.com/.
I currently have my
basePath
,assetsStaticBasePath
, andassetPrefix
values in next.config.js set so that my static assets (ie. images) load when the site is accessed via https://customdomain.com/mysite. Static assets fail to load if the user visits https://mysitehost.customdomain.com/ directly.I would like static assets to load properly via both entry points. To do this, I need to get the current domain in next.config.js.
Is there a way to do this?
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions