DEV Community

Brandon Fong
Brandon Fong

Posted on

Running Nextcloud on TrueNAS behind Nginx Reverse Proxy

How I got mine to work with Nextcloud running on TrueNAS using a Rpi 3 my DNS provider & Nginx Proxy.

Cloudflare

  • Create an A record pointing domain to private address of your Nginx Proxy Manager: npm.example.com
  • Create a CNAME record for all subdomains: *.example.com

Pi-hole (Docker Tag 2024.07.0 Pi-hole v5.18.3 FTL v5.25.2 Web Interface v5.21) configuration

  • Add DNS record pointing to the Nginx Proxy Manager host: npm.example.com -> 192.168.x.x
  • Add a CNAME record: nc.example.com -> npm.example.com

TrueNAS (ElectricEel-24.10.0.2) Config

  • clear the Host name field
  • Use the truenas_default certificate
  • No additional environment variables
  • Uncheck Use different port for URL rewrites
  • Port 9001

Nginx Proxy Manager (v2.12.1)

  • Proxy Host entry:

    • Domain Names: nc.example.com
    • Scheme: https
    • Forward Hostname / IP: Truenas' private ip on my network
    • Port: 9001
    • Custom Nginx Config:
      client_body_buffer_size 512k;
      proxy_read_timeout 86400s;
      client_max_body_size 0;
    
  • SSL Certificate creation:

Nextcloud config.php modifications

  • 'overwrite.cli.url' => 'https://nc.example.com'
  • 'overwritehost' => 'nc.example.com'
  • 'overwriteprotocol' => 'https'
  • Add nc.example.com to trusted_domains
  • Add Pihole's ip address to trusted_proxies
  • I'd also back this file up as I don't know what will happen to it during an update through TrueNAS

Top comments (0)