NGINX proxypass for Nextcloud PI

Hi !
I have a dedicated server running my website. The server runs Ubuntu 16.04 server and NGINX.

SSL is installed using Certboot and everything works great.

My domain redirects all https://www.exampledomain to and all http is redirected to https
Now, I have installed NextcloudPI on a raspberry PI 3 and the installation seems to work fine.

My server have a local ip inside the firewall and I have set the PI to IP

I want to add a Nginx proxypass rule to the main server ( so that all requests to the NextcloudPI witch responds no ( gets directed to the raspberry running nextcloudPI and also SSL must be working and able to renew the SSL certificate in this configuration.
If possible, I want to use my already installed nginx running on the main server to do the proxy pass to the raspberry.

Any help to archive this would be great.

I have the same setup. I assume you want to terminate ssl at the proxy.
Here is the relevant part of the nginx config:

server {
    listen                      443 ssl;
    server_name       ;
    ssl_certificate             /path/to/letsencrypt/fullchain.pem;
    ssl_certificate_key         /path/to/privkey.pem;
    ssl_protocols               TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers   on;

    ssl_dhparam                 /path/to/dh.pem;	

    access_log                  /var/log/nginx/nc_exampledomain_access.log;
    error_log                   /var/log/nginx/nc_exampledomain_error.log;
    location / {
        proxy_pass                    ;
        proxy_read_timeout                      360;
        proxy_buffering                         off;
        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;

server {
    listen                      80 default_server;
    listen [::]:80              default_server;
    server_name       ;
    return                      301 https://$server_name$request_uri;

    #For LetsEncrypt
    root /usr/share/nginx/html;
    location ~ /.well-known {
        allow all;