# Nextcloud problems / questions

**URL:** https://dietpi.com/forum/t/nextcloud-problems-questions/15415
**Category:** Troubleshooting
**Created:** [29 December 2022 13:30 UTC](https://dietpi.com/forum/t/nextcloud-problems-questions/15415 "2022-12-29T13:30:27Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![hemertje](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/cdc98d/32.png) [@hemertje](https://dietpi.com/forum/u/hemertje)
#### Post date: [30 December 2022 08:42 UTC](https://dietpi.com/forum/t/nextcloud-problems-questions/15415/14 "2022-12-30T08:42:09Z")

</div>

`nano /etc/nginx/sites-available/default`

```auto
# /etc/nginx/sites-available/default
server {

        root /var/www;
        index index.php index.html index.htm index.nginx-debian.html;

        server_name YourDomain.com;

        include /etc/nginx/sites-dietpi/*.conf;

        location / {
                try_files $uri $uri/ =404;
        }

        location ~ \.php(?:$|/) {
                include snippets/fastcgi-php.conf;
                fastcgi_pass php;
        }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/YourDomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/YourDomain.com/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

    ssl_trusted_certificate /etc/letsencrypt/live/YourDomain.com/chain.pem; # managed by Certbot
    ssl_stapling on; # managed by Certbot
    ssl_stapling_verify on; # managed by Certbot

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; # managed by Certbot

}

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

        listen 80 default_server;
        listen [::]:80 default_server;

        server_name YourDomain.com;
    return 404; # managed by Certbot

}

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

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/nextcloud.YourDomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/nextcloud.YourDomain.com/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

    add_header Strict-Transport-Security "max-age=31536000" always; # managed by Certbot

    ssl_trusted_certificate /etc/letsencrypt/live/nextcloud.YourDomain.com/chain.pem; # managed by Certbot
    ssl_stapling on; # managed by Certbot
    ssl_stapling_verify on; # managed by Certbot

}

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

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

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

}

```

?

---

_[View the full topic](https://dietpi.com/forum/t/nextcloud-problems-questions/15415)._
