H
Homarrโ€ข2y ago
jade

Connecting multiple servers with dashdot/Reverse Proxying with nginx

Hello! Can I set Homarr to display stats about my unRaid server , cpu/ram/network/storage/ect?
I have three servers at my house running unRaid, I have installed Homarr on the server I have that runs all of my web apps and web server, can I install Homarr on the other two and link them together somehow? essentially allowing Homarr to display stats and info for all three?
206 Replies
Manicraft1001
Manicraft1001โ€ข2y ago
Yes, you can do that using the Dash. widget. Due to the complexity and millions of possible hardware combinations, we use Dash. for it and didn't make our own solution. Therefore, you'll have to setup Dash as well.
jade
jadeOPโ€ข2y ago
yes, i just found it, I'll get to working on that
jade
jadeOPโ€ข2y ago
alright, follow up question, ive got Dash. running on one of my servers, i can either point homarr to dash. via http://192.168.1.98 (internal static IP of the server running dash.) or use https, if I use https I cant get graphs to show up, if I use http then I cant get any of it to show up, is there something I can change from Homarr end, or is it an issue with Dash.?
No description
No description
jade
jadeOPโ€ข2y ago
Dash. is running http, but homarr is being reverse proxied with nginx and is running https
Manicraft1001
Manicraft1001โ€ข2y ago
Websites, that run on HTTPS, do not allow any embeds with HTTP. Therefore, your site must have the same protocol as Homarr.
jade
jadeOPโ€ข2y ago
the rest of my dashboard appears to be working fine, running under https, I just cannot get my graphs to show up, how do I know if homarr is actually running https or if its just being made to https with nginx
No description
Manicraft1001
Manicraft1001โ€ข2y ago
Homarr itself does not support HTTPS due to a limitation of the framework in use. We'll eventually implement a workaround, but we haven't had the time for that yet. You can check the protocol in your browser. The prefix indicates the protocol
jade
jadeOPโ€ข2y ago
its using https, so if i set nginx reverse proxy config back to HTTP only, it should be fine and I should get the graphs?
Manicraft1001
Manicraft1001โ€ข2y ago
Yes Or you can connect directly to Homarr. Note that HTTP will not encrypt your traffic. Therefore, we highly encourage you to use HTTPS I currently have very poor network connection. Sorry if any of my responses are delayed
jade
jadeOPโ€ข2y ago
no worries! currently i have a subdomain pointing to my house, nginx then reverse proxies that subdomain to my homarr instance, which im then connecting to the dash. instance with ive got https set with nginx and a certbot certificate, should I try removing that? if I connect locally then I can view the graphs using http, but my goal here is to be able to view the graphs from outside of my network, i.e. at work or school
Manicraft1001
Manicraft1001โ€ข2y ago
If you want them outside your network, proxy them like you do with Honarr Or, you could not expose them at all and use a VPN with unencrypted HTTP I use the second variant myself
jade
jadeOPโ€ข2y ago
true, so I would just reverse proxy the dash. instances with nginx as well?
Manicraft1001
Manicraft1001โ€ข2y ago
Yes, that is one possible way of doing it
jade
jadeOPโ€ข2y ago
only reason I don't use a VPN is its blocked on computers at school, however my domains arent
Manicraft1001
Manicraft1001โ€ข2y ago
Makes sense ๐Ÿ‘
jade
jadeOPโ€ข2y ago
they have forced network settings, we cant change them except to connect to wifi networks at our houses lol okay, thank you for your help! ill let you know if I have any other issues
Manicraft1001
Manicraft1001โ€ข2y ago
Sure! No problem Let me know if you need help
jade
jadeOPโ€ข2y ago
if I was able to use a vpn I wouldnt have to have monitoring available outside my house I would just use the unraid dashboard pages, but id wrather not expose the servers directly to the outside lol also this looks cooler ๐Ÿ˜‚
brunotco
brunotcoโ€ข2y ago
Even after you out both homarr and dash behind nginx you might get problems with the graphs, ir you use different subdomains on them, I had
jade
jadeOPโ€ข2y ago
no reason i cant use the same subdomains
brunotco
brunotcoโ€ข2y ago
Yes, I just pointed that because I used different ones
jade
jadeOPโ€ข2y ago
gotcha
brunotco
brunotcoโ€ข2y ago
I setup dash.domain and homarr.domain If you don't do that you should be fine
Manicraft1001
Manicraft1001โ€ข2y ago
Oh, that is not expected. Can you DM me a domain example?
brunotco
brunotcoโ€ข2y ago
Yes I can
Manicraft1001
Manicraft1001โ€ข2y ago
Thanks. Can you also open an issue on GitHub and tag me? As long as the Domain both are the same protocol, there should be no problem.
brunotco
brunotcoโ€ข2y ago
Yes I'll do it later ๐Ÿ˜‰
jade
jadeOPโ€ข2y ago
@brunotco can you help me out with reverse proxying? i have dashboard.domain.us/romeo/ proxy passed to the interal ip and port of dashdot instance, but when i visit the url in my browser, it says "cannot GET /romeo/" and dashdot cant find the instance
jade
jadeOPโ€ข2y ago
No description
No description
No description
brunotco
brunotcoโ€ข2y ago
I'll try ๐Ÿ˜‹ This is inside Homarr right? And this is on the browser at /romeo/
jade
jadeOPโ€ข2y ago
the first ss is my nginx reverse proxy config, the 2nd is in homarr, and the third is my browser
brunotco
brunotcoโ€ข2y ago
Ok But you can get to dash. with ip:3001?
jade
jadeOPโ€ข2y ago
its reverse proxied so i dont have the port facing outward, lemme forward the port rq hang on internally tho, yes i can if i type in http://192.168.1.98:3001 i get my dashdot dashboard
brunotco
brunotcoโ€ข2y ago
Ok
jade
jadeOPโ€ข2y ago
and yes the same if i use my external ip
brunotco
brunotcoโ€ข2y ago
192.168.1.98 is your container IP or host IP?
jade
jadeOPโ€ข2y ago
thats the ip of the host running it in this case, the unraid server
brunotco
brunotcoโ€ข2y ago
And the nginx is in the same host?
jade
jadeOPโ€ข2y ago
nginx is in a vm on a different server
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
the unraid server ^
brunotco
brunotcoโ€ข2y ago
Can you check if the VM can reach the .98 host?
jade
jadeOPโ€ข2y ago
sure one sec
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
all good
brunotco
brunotcoโ€ข2y ago
Hum...
jade
jadeOPโ€ข2y ago
yeah its stumping me, theoretically it should all work
brunotco
brunotcoโ€ข2y ago
That's so strange Yeah xD Can you see on the browser when accessing /romeo/ if you get any log on the develop window?
jade
jadeOPโ€ข2y ago
404 not found interesting
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
On the proxypass to .98 Add / after port number And try again
jade
jadeOPโ€ข2y ago
ight, back to where i started ive got the storage and network text, no graphs
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
That's normal XD
jade
jadeOPโ€ข2y ago
in console
No description
jade
jadeOPโ€ข2y ago
ok, so how can I get the graphs to show up?
brunotco
brunotcoโ€ข2y ago
Go to the widget settings
jade
jadeOPโ€ข2y ago
in homarr or dashdot?
brunotco
brunotcoโ€ข2y ago
Homarr
jade
jadeOPโ€ข2y ago
ighty
brunotco
brunotcoโ€ข2y ago
The dash widget in homarr you named Romeo
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
Yes
jade
jadeOPโ€ข2y ago
there ya go
brunotco
brunotcoโ€ข2y ago
Storage open it
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
And uncheck the option of text compact
jade
jadeOPโ€ข2y ago
okay, still no graphs are showing up tho
brunotco
brunotcoโ€ข2y ago
Can you print the widget now?
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
Hum I think the widget is there because of the blank space
jade
jadeOPโ€ข2y ago
should I forward those extra ports too? or proxy i should say
brunotco
brunotcoโ€ข2y ago
But you're getting 404 errors
jade
jadeOPโ€ข2y ago
mhm
brunotco
brunotcoโ€ข2y ago
No problem not ports
jade
jadeOPโ€ข2y ago
the dashboard. domain as itself only forwards to the homarr instance running the dashdot instance is another machine if its trying to get a port from the dashdot instance for the graphs but it doesnt exist because its not being proxied back
brunotco
brunotcoโ€ข2y ago
I think it uses iframes so that's not the problem Try this to check On Homarr add a widget - iframe
jade
jadeOPโ€ข2y ago
ight what should i use for the url?
Manicraft1001
Manicraft1001โ€ข2y ago
Yes, it does use iframes
brunotco
brunotcoโ€ข2y ago
Your https://fullurl/romeo/?graphs=cpu Sorry graph and not graphs It should show you the CPU graph from dash.
jade
jadeOPโ€ข2y ago
blank white page
jade
jadeOPโ€ข2y ago
what dashdot shows:
No description
brunotco
brunotcoโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
on homarr:
No description
brunotco
brunotcoโ€ข2y ago
I use it like that and have this
jade
jadeOPโ€ข2y ago
strange
brunotco
brunotcoโ€ข2y ago
Ok so it looks like it could be some kind of CORS problem or something... On the browser logs any error?
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
Do me a favor go to Network tab And refresh the browser Than print it please
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
if i visit this in my browser heres the console for that
No description
jade
jadeOPโ€ข2y ago
using graph tho not graphs if thats any help
brunotco
brunotcoโ€ข2y ago
Yeah Your getting 404 on the dash. requests
jade
jadeOPโ€ข2y ago
should i try to port forward dash. directly to outside and use that?
brunotco
brunotcoโ€ข2y ago
You can try it Oh wait Do you have internal DNS? Pointing your domain to the reverse proxy?
jade
jadeOPโ€ข2y ago
when i do that the graph boxes change to (external ip) sent an invalid response domain is registered with cloudflare lemme check
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
readacted my external ip but its just forwarding the domain
brunotco
brunotcoโ€ข2y ago
Ok I think the problem could be your Homarr container can't point the dashboar.domain to the reverseproxy
jade
jadeOPโ€ข2y ago
okay, but in homarr if i use my external ip and the dashdot port instead i get invalid response
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
With this what do you have in the browser logs?
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
Did you refresh Homarr after changed to external IP?
jade
jadeOPโ€ข2y ago
yes it didnt safve hang on i forgot to save it
brunotco
brunotcoโ€ข2y ago
Ok Worked with external?
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
thats the iframe, and the same thing in the graphs
brunotco
brunotcoโ€ข2y ago
https://ip:port/?graphs=cpu Does it give you the CPU graph?
jade
jadeOPโ€ข2y ago
invalid response
No description
brunotco
brunotcoโ€ข2y ago
Change it to http Instead of https
jade
jadeOPโ€ข2y ago
blank white
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
it doesnt like not being over https
brunotco
brunotcoโ€ข2y ago
Yeah it will not work with http it was just to test it out
jade
jadeOPโ€ข2y ago
sooo
brunotco
brunotcoโ€ข2y ago
You have to get it working with the proxy
jade
jadeOPโ€ข2y ago
yeaha i can try dropping the dashboard page itself to http, dropping using certbot and all that stuff
brunotco
brunotcoโ€ข2y ago
Let's recap
jade
jadeOPโ€ข2y ago
okay
brunotco
brunotcoโ€ข2y ago
With /romeo/ you can access the dash. page right?
jade
jadeOPโ€ข2y ago
no, blank white screen
brunotco
brunotcoโ€ข2y ago
Oh I thought it was working
jade
jadeOPโ€ข2y ago
nah
brunotco
brunotcoโ€ข2y ago
And if you add info
jade
jadeOPโ€ข2y ago
i can get dashdot using the internal ip or using the external ip
brunotco
brunotcoโ€ข2y ago
/romeo/info?
jade
jadeOPโ€ข2y ago
but not the fqdn
jade
jadeOPโ€ข2y ago
No description
jade
jadeOPโ€ข2y ago
gives me that
brunotco
brunotcoโ€ข2y ago
Ok so it is reachable Then why the hell you get that white screen at /romeo/? XD
jade
jadeOPโ€ข2y ago
this is interesting, connectiong to homarr using its internal ip, i can see the dashdot page in the iframe with the iframe set to the external ip and port of my house but if i use the fqdn to access homarr, i get a white screen in the iframe
brunotco
brunotcoโ€ข2y ago
Yeah
jade
jadeOPโ€ข2y ago
is that expected?
brunotco
brunotcoโ€ข2y ago
Because your using dash with http so accessing homarr with ip gives you the graph
jade
jadeOPโ€ข2y ago
ah i still couldnt connect to dashdot using the integration tho
brunotco
brunotcoโ€ข2y ago
The problem you're having is in dash. behind the reverse proxy
jade
jadeOPโ€ข2y ago
yeah
brunotco
brunotcoโ€ข2y ago
It's reachable because /info works
jade
jadeOPโ€ข2y ago
yeah
brunotco
brunotcoโ€ข2y ago
But for some reason the main page is not loading
jade
jadeOPโ€ข2y ago
yerp
brunotco
brunotcoโ€ข2y ago
In /romeo/ do you have any browser logs errors?
jade
jadeOPโ€ข2y ago
with or without the info with the info, no errors without the info, yes
jade
jadeOPโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
Yeah some problem there That's the errors you were getting on homarr
jade
jadeOPโ€ข2y ago
yeah 404 not found for some reason is it something id have to change with dashdot?
brunotco
brunotcoโ€ข2y ago
I'm not really sure now ๐Ÿ˜…
jade
jadeOPโ€ข2y ago
lol its alright
brunotco
brunotcoโ€ข2y ago
If the problem is with the iframes You could try what I did Add to /romeo/ add Content Security Policy header
jade
jadeOPโ€ข2y ago
whats that? ive got like very basic understanding of this stuff lol
brunotco
brunotcoโ€ข2y ago
But it's accessing directly to /romeo/ so don't think it would do much difference You can try it On nginx
jade
jadeOPโ€ข2y ago
what should i add to the cfg?
brunotco
brunotcoโ€ข2y ago
add_header Content-Security-Policy "frame-ancestors 'self' 'domain.com';"; Change the domain.com for your domain And give it a try ๐Ÿ˜‰
jade
jadeOPโ€ข2y ago
so add_header Content-Security-Policy "frame-ancestors 'self' 'dashboard.kinglego.us';"; ? if its located at dashboard.kinglego.us?
brunotco
brunotcoโ€ข2y ago
Yeah xD not really making much sense xD It works for me because of the subdomains and I pass a subdomain there
jade
jadeOPโ€ข2y ago
yeah same errors the tab changes to dash. but still a blank white page
brunotco
brunotcoโ€ข2y ago
I'll try to see something about dashdot reverse proxy
jade
jadeOPโ€ข2y ago
kk
jade
jadeOPโ€ข2y ago
hers what i get from homar
No description
jade
jadeOPโ€ข2y ago
๐Ÿ“Ÿ Dash. | Homarr Docs
The Dash. widget will integrate your existing Dash. instance into Homarr. The graphs will be integrated using iframe.
jade
jadeOPโ€ข2y ago
@brunotco thats all ive been able to find i didnt even find anything on the dashdot page to suggest reverse proxy
brunotco
brunotcoโ€ข2y ago
I tried searching and also didn't find anything relevant on it I can try to simulate your environment and see what happens Ok so I kinda got the problem the https://domain/romeo/ is ok but it gives 404 errors because it's trying to load resources from https://domain/assets and not https://domain/romeo/assets
Manicraft1001
Manicraft1001โ€ข2y ago
Wait, I have to quickly ask here. I didn't read your conversation above, but are you trying to use Homarr at a path (eg. domain/homarr )?
jade
jadeOPโ€ข2y ago
no
Manicraft1001
Manicraft1001โ€ข2y ago
Ah okay. Because Homarr is not compatible with subpaths
jade
jadeOPโ€ข2y ago
so, would putting dashdot behind its own subdomains work? attempting to connect to dashdot using subpaths that are reverse proxied because i cant just forward /domain/assets to the one dashdot instance because eventually im going to have multiple running
brunotco
brunotcoโ€ข2y ago
yes and that is the problem what I tested was accessing /romeo/ that points to dashdot I get 404 errors and one of them is http://dash.test.local/assets/logo192.png can't find this image, it's the dashdot tab icon and it's normal because it's really inside /romeo/assets
jade
jadeOPโ€ข2y ago
so if i instead point it to something.domain.com instead of domain/something it would work?
brunotco
brunotcoโ€ข2y ago
and it's like you say, can't /assets to /romeo/assets cause if you get another that as assets in /assets you gonna have problems yes it's my setup
jade
jadeOPโ€ข2y ago
alrighty, and its gonna have to be a subdomain for each?
brunotco
brunotcoโ€ข2y ago
dash.domain.com and homarr.domain.com
jade
jadeOPโ€ข2y ago
gotcha thanks!
brunotco
brunotcoโ€ข2y ago
for you
jade
jadeOPโ€ข2y ago
ill try that when i get the chance and let you know
brunotco
brunotcoโ€ข2y ago
you can have just a subdomain on dashdot and leave homarr as it is
jade
jadeOPโ€ข2y ago
yep
brunotco
brunotcoโ€ข2y ago
instead of using domain.com/romeo use romeo.domain.com try it and then give your feedback ๐Ÿ˜›
jade
jadeOPโ€ข2y ago
will do, im travelling today but ill have times to work on it, thanks so much!
brunotco
brunotcoโ€ข2y ago
no problem in the meantime I'm a little stubborn xD I got it to work with the setup you wanted ๐Ÿ˜›
brunotco
brunotcoโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
got it working on /dot/
brunotco
brunotcoโ€ข2y ago
No description
brunotco
brunotcoโ€ข2y ago
and iframe shows on homarr
jade
jadeOPโ€ข2y ago
how
brunotco
brunotcoโ€ข2y ago
I added a rule on nginx
if ($http_referer ~ ^https?://dash.test.local/dot) {
rewrite ^/(.*)$ /dot/$1 last;
}
if ($http_referer ~ ^https?://dash.test.local/dot) {
rewrite ^/(.*)$ /dot/$1 last;
}
when you have a request that's from /dot/ that's the referer rewrite the request to add /dot/ so the wrong request for domain/assets/icon is changed to domain/dot/assets/icon basically all asked from inside /dot/ stays inside /dot/ and doesn't move to the / (root)
jade
jadeOPโ€ข2y ago
ah okay
brunotco
brunotcoโ€ข2y ago
try it when you can
jade
jadeOPโ€ข2y ago
That seems to be working beautifully, thank you so much! im gonna go ahead and start rolling it to other servers as well, ill let you know if i get any issues! but thank you again, i know this is a strange case @manicraft1001 is there a way some of this can be added to the docs on the homarr site? i can summarize what ive done here, i cant imagine im the only one who has this setup
Manicraft1001
Manicraft1001โ€ข2y ago
Yes, absolutely. On each documentation page, there is an edit link at the bottom. Click on that and then edit the text. You need a GitHub account for that. Please add it to the Proxies & Certificates page ๐Ÿ™‚ Good work everyone here for the awesome collaboration
jade
jadeOPโ€ข2y ago
will do
Manicraft1001
Manicraft1001โ€ข2y ago
Awesome. Thanks for finding out a solution Let us know if you have questions with the documentation We'll review the content once you submit a pull request.
Thomas
Thomasโ€ข2y ago
That would be really awesome thank you so much
jade
jadeOPโ€ข2y ago
alrighty, got a chance to write out a draft real quick, what do yall think?
Reverse Proxy with NGINX - Example for multiple instances of Dash.
Because Dash. uses iframes to display the graphs, you can run into problems when using a reverse proxy to access them. There are two ways you can do this, either by using subdomains for each instance of Dash. or by using subpaths.

You can use a subdomain for each instance of Dash. and simply use instanceone.domain.come, instancetwo.domain.com, instancethree.domain.com, ect. for your instances, and simply point anything sent to that domain to your Dash. instance in NGINX. That would require seperate configuration files and subdomains for each instance. (INSERT EXAMPLE OF THAT HERE)

You can also use subpaths, which only requires one subdomain and configuration file for each, allowing your Dash. and your Homarr instances to all exist on the same subdomain. However, when Homarr attempts to pull the iframes, it will attempt to pull from sub.domain.com/assets, instead of sub.domain.com/instance/assets. So, you simply rewrite the incomming requests and modify the path, and that will connect your Homarr and Dash. instances. (INSERT EXAMPLE OF THAT HERE)
Reverse Proxy with NGINX - Example for multiple instances of Dash.
Because Dash. uses iframes to display the graphs, you can run into problems when using a reverse proxy to access them. There are two ways you can do this, either by using subdomains for each instance of Dash. or by using subpaths.

You can use a subdomain for each instance of Dash. and simply use instanceone.domain.come, instancetwo.domain.com, instancethree.domain.com, ect. for your instances, and simply point anything sent to that domain to your Dash. instance in NGINX. That would require seperate configuration files and subdomains for each instance. (INSERT EXAMPLE OF THAT HERE)

You can also use subpaths, which only requires one subdomain and configuration file for each, allowing your Dash. and your Homarr instances to all exist on the same subdomain. However, when Homarr attempts to pull the iframes, it will attempt to pull from sub.domain.com/assets, instead of sub.domain.com/instance/assets. So, you simply rewrite the incomming requests and modify the path, and that will connect your Homarr and Dash. instances. (INSERT EXAMPLE OF THAT HERE)
if yall think it looks good, ill add in the examples and submit the fork or whatever its called idk i dont work with git much lol
Manicraft1001
Manicraft1001โ€ข2y ago
Looks fine. Would be nice if you could do a PR for this, so we can see the full text
jade
jadeOPโ€ข2y ago
i will when I get the chance to add in examples u didnt see that
Manicraft1001
Manicraft1001โ€ข2y ago
I did ๐Ÿ˜„ Sadly, we have logs of deleted messages xD
jade
jadeOPโ€ข2y ago
shh ugh
Manicraft1001
Manicraft1001โ€ข2y ago
Anyhow, I don't mind lmao Just do the pull request ๐Ÿ˜„
jade
jadeOPโ€ข17mo ago
ill have to write the examples to up* @manicraft1001 sorry it took so long, ive had a bunch of stuff come up, but I just committed a pr (i think, never done it before) lmk if i need to update/modify it at all
jade
jadeOPโ€ข17mo ago
Manicraft1001
Manicraft1001โ€ข17mo ago
Wow, I really appreciate that you didn't forget about it Can you open a pull request to the Homarr Docs repository? I quickly glanced over it and it looked really good so far Thanks โค๏ธ
jade
jadeOPโ€ข17mo ago
GitHub
Update dashdot-widget.md by KingLego2006 ยท Pull Request #72 ยท ajnar...
Thank you for contributing to Homarr! So that your Pull Request can be handled effectively, please populate the following fields (delete sections that are not applicable) Category One of: Bugfix /...
jade
jadeOPโ€ข17mo ago
did i do it correctly?
Want results from more Discord servers?
Add your server