I’m at my wits’ end with NPM on my TrueNAS Scale server. Everything was going smoothly until I tried to set up a custom location for NPM.
I’ve got my server running TrueNAS Scale and Tailscale. I moved some ports around and got TrueNAS admin and NPM working fine through my Tailscale domain.
But when I tried to make NPM accessible through a custom path, it all went south. Now I’m getting weird errors, blank pages, and MIME type mismatches. I’ve tried tweaking the Nginx config, but nothing seems to work.
I just want to access my services through subpaths like /nginx and /nextcloud. Is that too much to ask?
hey man, i’ve been there. npm can be a real pain. tried using a reverse proxy like traefik? it’s way easier to setup subpaths. create a middleware for path stripping and you’ll be set. might save some headaches down the line
I’ve encountered similar challenges with NPM on TrueNAS Scale. One solution that worked for me was to use the ‘rewrite’ directive in the Nginx configuration. Here’s an example:
This approach preserves the original URL structure while forwarding requests to the correct backend. Remember to adjust the proxy_pass URL to match your NPM’s actual address and port.
Additionally, ensure that your NPM’s container settings allow it to handle proxy requests properly. You might need to add or modify some environment variables in the container configuration.
If you’re still experiencing MIME type issues, double-check that your NPM installation is up-to-date and that all necessary modules are enabled in Nginx.
I feel your pain with NPM configuration woes. I ran into similar issues when setting up subpaths on my TrueNAS Scale box. What eventually worked for me was adjusting the NPM container’s environment variables rather than messing with Nginx configs directly.
Try adding these environment variables to your NPM container:
NGINX_PROXY_LOCATION=/nginx
DISABLE_IPV6=true
Then, in the NPM UI, make sure to update your proxy host settings to reflect the new base location. For other apps like Nextcloud, you’ll need to tweak their configs to work with the subpath.
It took some trial and error, but this approach finally got my subpaths working correctly without MIME issues or blank pages. Hope this helps point you in the right direction!