Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to host this public-demo on vps with custom domain? #37

Open
LoydAndrew opened this issue Jan 9, 2024 · 0 comments
Open

How to host this public-demo on vps with custom domain? #37

LoydAndrew opened this issue Jan 9, 2024 · 0 comments

Comments

@LoydAndrew
Copy link

Okay, I tried different approaches with no luck. Requests from localhost next site to localhost payload are working, but from custom.localhost to custom.localhost aren't. I'm using caddy for reverse proxy in docker and tried to host payload API on subdomain API.custom.localhost but fetch will throw error on server indicating address error. If I use client side requests instead of server components requests or curl it's working either way, but I still will have issues with displaying images on custom domain: request to this url https://custom_domain/_next/image?url=https%3A%2F%2Fcustom_domain%2Fmedia%2Fexample.png&w=2048&q=75 will throw error, even though url of the media is valid and I have custom_domain in next.config

  images: {
    remotePatterns: [
      { hostname: 'localhost', protocol: 'http' },
      { hostname: 'custom_domain', protocol: 'https' },
    ],
  },

custom_domain is obviously a placeholder for my real domain.
I see that next js public-demo is actually being hosted on cloudflare, so maybe that's why there is no prolblem with routing resolultions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant