I have reviewed the post https://www.truenas.com/community/threads/reverse-proxy-for-ui.86873/ and I can get that to work.
<IfModule mod_proxy.c>
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://server-name/$1 [P,L]
ProxyPass "/" "http://server-name/"
ProxyPassReverse "/" "http://server-name/"
</IfModule>
This is fine but I would like to access TrueNas at "/nas/" rather than "/". Has anyone had success at doing this? I am guessing that TrueNas is using absolute paths for resources under /ui, but I am not sure how to resolve that in a reverse proxy.
What I am looking for would look something like below:
<IfModule mod_proxy.c>
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://server-name/$1 [P,L]
ProxyPass "/nas/" "http://server-name/"
ProxyPassReverse "/nas/" "http://server-name/"
</IfModule>
This does not work as TrueNas seems to be using absolute paths and looks for resources in http:/proxy.com/ui/some.css instead of http://proxy.com/nas/ui/some.css.
<IfModule mod_proxy.c>
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://server-name/$1 [P,L]
ProxyPass "/" "http://server-name/"
ProxyPassReverse "/" "http://server-name/"
</IfModule>
This is fine but I would like to access TrueNas at "/nas/" rather than "/". Has anyone had success at doing this? I am guessing that TrueNas is using absolute paths for resources under /ui, but I am not sure how to resolve that in a reverse proxy.
What I am looking for would look something like below:
<IfModule mod_proxy.c>
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://server-name/$1 [P,L]
ProxyPass "/nas/" "http://server-name/"
ProxyPassReverse "/nas/" "http://server-name/"
</IfModule>
This does not work as TrueNas seems to be using absolute paths and looks for resources in http:/proxy.com/ui/some.css instead of http://proxy.com/nas/ui/some.css.