TrueNAS behind nginx - Web UI for apps fail

I have setup TrueNAS Community 25.04.2.4 behind a NGINX proxy (TrueNAS running on ports 8080 and 4443).
When I access TrueNAS via the proxy - truenas_domain_com, I can access TrueNAS UI just fine - but when I go to my installed apps and click on Web UI (for one of the apps), it try to open truenas_domain_com:XXXXX (where XXXXX is the port) - and it can’t find it because port XXXXX is not included in the NGINX proxy.
When I open TrueNAS via the local IP everything works.
Is this possible to solve - and how do I solve this - or is it by design?

By proxying the apps themselves with NPM.

2 Likes

Hi Dan,
Can you give me a hint on how to do that i NGINX - I tried to add the ports for the apps to truenas_domain_com - but I get that I can only define one port for the domain.
I’m quite new to the proxy setup in NGINX.

Why would you do that? Wouldn’t you want each app to have its own name? Because that’s how you’d set it up. Some further discussion of this here:

I have just checked the Wiki - and it seems I have done the setup acording to the Wiki.
But do I need a Proxy Host configured for each app (app_truenas_domain_com)?
And when I click on the Web UI, for the app, it opens truenas_domain_com:xxxxx not app_truenas_domain_com:xxxxx
Do I need to make changes to the apps inside of TrueNAS?
Sorry - but I’m new at this.

Yes, though I’d think you’d want something more like app.lan.domain.com or app.domain.com.

Yeah, don’t do that.

No.

Ok. So if I understand you right - when TrueNAS is behind a proxy, the Web UI buttons won’t work - you can only open the Web UI by opening app_truenas_domain_com:xxxxx directly?

Yes but it’s easier than that. With NPM or Caddy, you specify the upstream port along with the ip in the config, so you’re not putting app_truenas_local:5300 in the url bar. Just app_truenas_local for each app (they should all have a unique name).

So you have a dns entry for each host that points at npm for the ip. Npm receives a header looking for app2_truenas_local and it serves it if it finds a match, because you’ve told npm the true ip and port that hosts the application.

You can go a step further with Truenas and bind different IP addresses to each app but that’s another can of worms.

Edit: nothing is behind a proxy, npm is a reverse proxy. Terminology matters here with understanding how it works.