1

I've configured my server "Ada" with TrueNAS Scale 24.10.2 and Tailscale using my domain iguana-centauri.

I can access it perfectly via ada.iguana-centauri.ts.net.

I moved the TrueNAS web admin HTTP port from 80 to 8090 (and NPM's HTTP port from 30021 to 80), and now I can easily access TrueNAS webadmin via ada.iguana-centauri.ts.net:8090, the NPM admin via ada.iguana-centauri.ts.net:30020, and the NPM "Congratulations" page via ada.iguana-centauri.ts.net. Perfect.

I then configured a proxy host in NPM with domain name ada.iguana-centauri.ts.net, HTTP schema, forward hostname/IP pointing to 192.168.68.68 (TrueNAS internal network IP) and port 8090, with WebSockets Support and Block Common Exploits turned ON. It works flawlessly to access TrueNAS webadmin. (Nginx is still accessible via :30020.)

And then, all hell breaks loose.

When I attempt to configure a Custom Location to access NPM itself via ada.iguana-centauri.ts.net/nginx, everything stops working:

  • ada.iguana-centauri.ts.net starts returning the NPM "Congratulations" page, as if accessed directly via IP.
  • ada.iguana-centauri.ts.net/nginx returns a blank page that seems to contain some MHTML of the NPM manager interface, but nothing loads properly, and the browser complains about MIME type (text/html) mismatch (X-Content-Type-Options: nosniff) for external resources, apparently rewriting their URLs incorrectly.

I tried various approaches, such as the custom rules script below, but everything just gets worse, resulting in 404 or 502 errors:

rewrite ^/nginx(/.*)?$ $1 break;
proxy_http_version 1.1;
proxy_set_header Host localhost;
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;
proxy_set_header X-Forwarded-Prefix /nginx;

Ultimately, my goal was to access services via subpaths (/nginx, /nextcloud, etc.), but now I'm stuck.

Help!

1 Answers1

0

The custom locations feature on NPM is broken. It does substitute the initial URL but won't rewrite them correctly internally and thus sites/services won't load css, js, images, etc.

The reason I was looking for custom locations is because, as of today, Tailscale won't allow subdomains in a MagicDNS domain for a single machine.

What solved my problem was to get a domain myself and assign subdomains for each service in my TrueNAS. I did that by following this awesome tutorial by Thomas Wilde:

https://www.youtube.com/watch?v=Y7Z-RnM77tA

As a bonus, I got SSL certificates almost seamlessly.