Nextcloud CertBot let’s encrypt ERR_TOO_MANY_REDIRECTS

VD_BE

Cadet
Joined
Nov 3, 2020
Messages
7
I have nextcloud running on my Truenas with SSL.
Previously I used this howto by Florian Rhomberg what worked on nextcloud 22
Now I updated and by doing that I rebuild everything from scratch since I did the update process wrongly. So now using nextcloud 27, this above howto doesn't work anymore.

I receive ERR_TOO_MANY_REDIRECTS on local (192.168.0.12) and also on remote access.

This howto also I tried to do but without success; https://sysadmin102.com/2021/11/ins...l-certificate-from-lets-encrypt-with-certbot/

my nginx nextcloud.conf is
Code:
upstream php-handler {
    server unix:/var/run/nextcloud-php-fpm.sock;
}

# Redirect to HTTPS
server {
    server_name nextcloud.domain.com;

    location ^~ /.well-known/acme-challenge {
        # Path to the root of your installation
        root /usr/local/www/nextcloud/;
        try_files $uri $uri/ =404;
    }

    location / {
       return 301 https://$host:443$request_uri;
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /usr/local/etc/letsencrypt/live/nextcloud.domain.come/fullchain.pem # managed by Certbot
    ssl_certificate_key /usr/local/etc/letsencrypt/live/nextcloud.domain.com/privkey.pem # managed by Certbot
    include /usr/local/etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /usr/local/etc/letsencrypt/live/nextcloud.domain.com/chain.pem # managed by Certbot

}

server {
    listen 443 ssl http2;
    server_name _;

    # HSTS settings
    # WARNING: Only add the preload option once you read about
    # the consequences in https://hstspreload.org/. This option
    # will add the domain to a hardcoded list that is shipped
    # in all major browsers and getting removed from this list
    # could take several months.
    add_header Strict-Transport-Security "max-age=15768000; includeSubDomains;">

    include conf.d/nextcloud.inc;

}

server {
    if ($host = nextcloud.domain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

 
    listen 80 default_server;
    listen [::]:80;
    server_name nextcloud.domain.com;
    return 404; # managed by Certbot
 
}


Does anyone can guide me where the redirects are hidden please?
 
Last edited:

VD_BE

Cadet
Joined
Nov 3, 2020
Messages
7
Seen the many threads about this subject... And few responses here and there on older versions. I hope Truenas/Nextcloud will improve this and make things easier to implement SSL
 
Top