Nextcloud AIO in domain subfolder (https://my.domain/nextcloud/*)

Hello all. I’m running Nextcloud AIO v9.8.0 via Docker and I’m running into an issue with my setup. I already use my domain for another application and the domain root is used for that app. So anything hitting https://my.domain (any port) will be proxied to that app.

What I’m trying to set up is to have anything hitting https://my.domain/nextcloud/ get redirected to nextcloud featureqs/UIs etc…

When doing the nextcloud setup wizard, it only has an option to set up a domain (without slashes). So I guess my first question is, is this even possible? Will it be supported by ios apps etc even if I do get it to work? I’m mainly looking to handle ios photos.

My second question is. Because of this, any links/redirects in the application just point to my domain and do not include /nextcloud which obviously doesn’t work.

The setup I have (will post config bellow) works in the sense that the reverse proxy is properly sending requests to nextcloud. I’ve tested this by getting the nextcloud 404 error. But if I just hit https://my.domain/nextcloud/ I get redirected to https://my.domain/login (and the same happens for all static files, thenextcloud gets removed)

This really just looks like I’m missing a configuration somewhere and I was hoping someone here could help me figure out what config that is.

For the record, my docker configuration is:

nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    init: true
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    ports:
      - 8083:8080
    expose:
      - 11000
    networks:
      - reverse-proxy-network
    environment:
      - APACHE_PORT=11000
      - APACHE_IP_BINDING=0.0.0.0
      - NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_datadir
      - SKIP_DOMAIN_VALIDATION=true

And I’m using caddy for proxying with the following section in my caddyfile:

 handle_path /nextcloud/* {
    redir /.well-known/carddav /remote.php/dav/ 301
    redir /.well-known/caldav /remote.php/dav/ 301
    header Strict-Transport-Security "max-age=15768000;includeSubDomains;preload"

    reverse_proxy nextcloud-aio-apache:11000 {
      header_up X-Real-IP {remote_host}
    }
  }

Any help would be appreciated. Thanks!!

Hi, see GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

one line in the doc with all the answers I needed. Not sure how I missed that either. Thank you.

tldr: not supported and won’t be supported

You could use:

nc.domain.tld for Nextcloud (or whatever you want).

Any reverse proxy capable of routing traffic via a sub-folder is also capable of routing a sub-domain instead. Can use the same domain, IP address, ports, etc.

There are only a few reasons to use a sub-folder deployment these days.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.