map $host $nextcloud { default nextcloud; }

server {
    listen      80;
    listen      [::]:80;
    server_name nextcloud.shore.co.il;
    include     snippets/www-acme-challenge.conf;
    include     snippets/redirect-https.conf;
}

server {
    listen      443 ssl;
    listen      [::]:443 ssl;
    server_name nextcloud.shore.co.il;
    include     snippets/ssl.conf;
    include     snippets/nextcloud-well-known.conf;

    location / {
        proxy_pass              http://$nextcloud$request_uri;
        proxy_http_version      1.1;
        include                 snippets/proxy-headers.conf;
        proxy_hide_header       X-Frame-Options;
        client_max_body_size    512m;
    }
}
