Sorting out issues with Nextcloud ports and Caddy

Since I rest default, do I have to specify something in there again? In the server block there’s a spot where it looks like it wants me to put something in:

server {
    listen 80;
    listen [::]:80;
    server_name _;  #<<< here
    return 301 https://$host$request_uri;
}

You don’t have to edit the default file.

So if everything is default it should work?

We don’t know what else you might have changed, so you have to try.
Can you access nextcloud using https now?

No I can’t. I get this when I go to my Nextcloud URL:

Is this through caddy or using the ip locally?

It’s with Caddy. I don’t have any ports exposed because it’s not required with Caddy (or any reverse proxy if I recall correctly.)

I would get it running locally on https before starting to mess with caddy. I’m not really going to help troubleshooting caddy as I don’t use it and it’s nothing we provide support for.

Ok here’s my docker-compose.yml:

 nextcloud:
    image: linuxserver/nextcloud
    container_name: nextcloud
    hostname: nextcloud
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=$TZ
    volumes:
      - /opt/docker/config/nextcloud:/config
      - /opt/docker/data/nextcloud:/data
    ports:
      - 8443:443
    depends_on:
      - nextcloud-db
    restart: unless-stopped

Going to http://192.168.50.16:8443/ gives me this:
Screenshot_2020-06-07 400 The plain HTTP request was sent to HTTPS port

and changing the http to https in the address bar just redirects me to cloud.haddock.cc and gives me this again:

Why are you trying to use http on the https port? Just use https:// at the beginning.
You will also have to modify your config.php so that it’s not redirecting to your domain.
I’m on mobile, in bed, and don’t know by heart what to modify.

What I would do is a fresh install. Before you edit config.php see if you can hit the webui at https://$IP-ADDRESS:8443

If you can then it’s a caddy configuration thing, and none of the linuxserver team use Caddy as we all use our own LetsEncrypt container as a reverse proxy, so we can’t really help. In which case best bet is to see if any other community members can help.

It looks like my config.php is empty. So I guess I haven’t modified it.

OK, I managed to fix it. The solution is in the Caddy thread. Thanks so much to everyone who helped!

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