Dual domain with one nextcloud instance

Hi,

This is a general question:

Is it possible to have one instance of Nextcloud that respond to 2 domains?
Thanks

Sure, point both domains to the same server, and make sure you add both domains to the nextcloud config trusted_domains (See: https://help.nextcloud.com/t/howto-add-a-new-trusted-domain/)

1 Like

Hi
I did that, but the GET ont tld2 return me a 302 and redirect me to tld1?

I use traefik as inbound proxy.

The conf I have is the following in the docker compose:

x-nc-common-lables: &nc-common-lables
  # Middlewares nc force https and adds additional headers
  traefik.http.middlewares.force-https.redirectscheme.scheme: https
  traefik.http.middlewares.force-https.redirectscheme.permanent: true
  traefik.http.middlewares.nc.headers.customrequestheaders.Forwarded-Proto: https
  traefik.http.middlewares.nc.headers.customFrameOptionsValue: SAMEORIGIN
  traefik.http.middlewares.nc.headers.framedeny: true
  traefik.http.middlewares.nc.headers.stsincludesubdomains: true
  traefik.http.middlewares.nc.headers.stspreload: true
  traefik.http.middlewares.nc.headers.stsseconds: 15552000
  traefik.http.middlewares.nc.headers.contentTypeNosniff: true
  traefik.http.middlewares.nc.headers.browserXssFilter: true

...
    labels:
      << : *nc-common-lables
      traefik.enable: true
      # Entrypoint and TLS
      traefik.http.routers.nc.entrypoints: "http,https"
      traefik.http.routers.nc.rule: "Host(`tld1`) || Host(`tld2`)"
      traefik.http.routers.nc.tls: true
      traefik.http.routers.nc.tls.certresolver: le
      traefik.http.routers.nc.service: nc
      # Middlewares
      traefik.http.routers.nc.middlewares: "force-https,nc,dav"
      # Service
      traefik.http.services.nc.loadbalancer.server.port: 80
      # Middleware nc-dav replaces .well-known paths for caldav and carddav with proper nextcloud path
      traefik.http.middlewares.dav.replacepathregex.regex: "^/.well-known/(web|cal|card)dav"
      traefik.http.middlewares.dav.replacepathregex.replacement: "/remote.php/dav/"

Thanks