DEV Community

Brandon Fong
Brandon Fong

Posted on • Edited 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

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay