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;

    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 :

    Alias /nextcloud "/var/www/nextcloud/"

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

        <IfModule mod_dav.c>
            Dav off

        SetEnv HOME /var/www/nextcloud
        SetEnv HTTP_HOME /var/www/nextcloud

    ErrorLog /var/log/apache2/nextcloud-error_log
    CustomLog /var/log/apache2/nextcloud-access_log common

config.php :

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

Don’ know if you ever figured this out. Also not sure if this is the answer, but your location block is for /nextcloud but you appear to be using just cloud.domain.tld instead of cloud.domain.tld/nextcloud

I did not solve that, are u talking about Alias /nextcloud "/var/www/nextcloud/" in the apache2 conf ?
Thanks for your reply, i’m really having a hard time with WebDav…

My bad, i though i was on my other issue. This one is solved by tweaking my config, i’ll post the answer soon as i forgot to do it.
Feel free to help me with my other issue if you’re familiar with WebDav :slight_smile:
Thanks again !