Set up reverse proxy now too many redirects


Nextcloud version (eg, 20.0.5): 25.0.3
Operating system and version (eg, Ubuntu 22.04): Ubuntu 22.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.52-1ubuntu4.2)
PHP version (eg, 7.4): 8.12

The issue you are facing:
I get a redirection error when setting up the nginx reverse proxy manager and change the port forwading in my router from nextcloud machine to reverse proxy machine

Is this the first time you’ve seen this error? (Y/N): Y

I set up a working nextcloud instance as a proxmox container with letsencrypt certificate. My router has a port forwarding rule to the nextcloud and it works.

Now I want to have a nginx proxy manager to set up multiple subdomains

and these subdomains to be redirected by the proxy manager.

So when I set up the nginx proxy manager I can get a new letsencrypt certificate.
But when I change the port forwarding in my router to the nginx proxy manager and try to get to my nextcloud I get “Umleitungsfehler”, which should be too many redirects.

apache conf from nextcloud:
<VirtualHost local_nextcloud_ip:80 [ipV6]:80>
ServerAdmin email adress
DocumentRoot /var/www/html/nextcloud/

Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
 Alias /nextcloud "/var/www/html/nextcloud/"

 <Directory /var/www/html/nextcloud/>
    Options +FollowSymlinks
    AllowOverride All
    Require all granted
      <IfModule mod_dav.c>
        Dav off
    SetEnv HOME /var/www/html/nextcloud
    SetEnv HTTP_HOME /var/www/html/nextcloud

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*)$1 [R,L]

nginx config in proxy manager:



server {
set $forward_scheme http;
set $server “local_nextcloud_ip”;
set $port 80;

listen 80;
listen [::]:80;

listen 443 ssl http2;
listen [::]:443 ssl http2;


Let’s Encrypt SSL

include /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf;
include /etc/nginx/conf.d/include/ssl-ciphers.conf;
ssl_certificate /etc/letsencrypt/live/npm-2/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/npm-2/privkey.pem;

HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

add_header Strict-Transport-Security “max-age=63072000;includeSubDomains; preload” always;

# Force SSL
include /etc/nginx/conf.d/include/force-ssl.conf;

access_log /data/logs/proxy-host-1_access.log proxy;
error_log /data/logs/proxy-host-1_error.log warn;

location / {

HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)

add_header Strict-Transport-Security “max-age=63072000;includeSubDomains; preload” always;

# Proxy!
include /etc/nginx/conf.d/include/proxy.conf;



include /data/nginx/custom/server_proxy[.]conf;

I hope it is easy to find the problem.
Thank you very much in advance

I am fairly sure the problem lies within the apache config…
Tried multiple changes in the nextcloud config…
‘overwritehost’ => ‘’,
‘overwriteprotocol’ => ‘https’,
‘overwritewebroot’ => ‘/’,
‘overwrite.cli.url’ => ‘’,
‘htaccess.RewriteBase’ => ‘/’,
‘trusted_proxies’ => [‘reverseproxy’],