My reverse proxy isn't working

Hey everyone !

I’m having a hard time configuring my reverse proxy. I followed the official guide and look at some other configuration on StackOverflow but none of them work. Right now when i try to reach cloud.domain.tld, it redirect me to the default Nginx page with the adresshttps://cloud.domain.tld//, with two backslash at the end.

I’m looking at it for too long now and i’m sure it’s pretty obvious… Thanks to anyone who takes the time to read this :slight_smile:

My config files :

/etc/nginx/conf.d/nextcloud.conf :

server {
	server_name cloud.domain.tld;

	client_max_body_size 0;
	underscores_in_headers on;

	location /nextcloud {
	proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        add_header Front-End-Https on;

        proxy_headers_hash_max_size 512;
        proxy_headers_hash_bucket_size 64;

        proxy_buffering off;
        proxy_redirect off;
        proxy_max_temp_file_size 0;
        proxy_pass http://192.168.0.42;
	}

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/cloud.domain.tld-0001/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/cloud.domain.tld-0001/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


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


	listen 80;
	server_name cloud.domain.tld;
    return 404; # managed by Certbot


}

/etc/apache2/sites-available/nextcloud.conf :

<VirtualHost 127.0.0.1:80>
    Alias /nextcloud "/var/www/nextcloud/"

    <Directory /var/www/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All

        <IfModule mod_dav.c>
            Dav off
        </IfModule>

        SetEnv HOME /var/www/nextcloud
        SetEnv HTTP_HOME /var/www/nextcloud
    </Directory>

    ErrorLog /var/log/apache2/nextcloud-error_log
    CustomLog /var/log/apache2/nextcloud-access_log common
</VirtualHost>

config.php :

$CONFIG = array (
  'passwordsalt' => '1dW90CNtiN2iSSLy7njN9gqylfh9Iq',
  'secret' => 'tFZH68r4AszKrf1TdYzWoikHreZ2Or2I8QJ/48hPVPAowetX',
  'trusted_domains' => 
  array (
	  0 => '192.168.0.42',
	  1 => 'cloud.domain.tld',
  ),
  'datadirectory' => '/mnt/data',
  'dbtype' => 'mysql',
  'version' => '17.0.1.1',
  
  'overwrite.cli.url' => 'https://cloud.domain.tld/',
  'overwritehost' => 'cloud.domain.tld',
  'overwriteprotocol' => 'https',
  'overwritewebroot' => '/',
  'htaccess.RewriteBase' => '/',
  
  'trusted_proxies' => ['192.168.0.19'],
  'dbname' => '*********',
  'dbhost' => '192.168.0.22:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '*********',
  'dbpassword' => '********',
  'instanceid' => 'ocmu5ni3zvnl',
  'installed' => true,
);