Hi,
I am trying to run UD behind a reverse proxy (Apache) and seems to fail.
The reverse proxy is set to listen to 443 and redirect to another PC on port 2000
It will ProxyPass /dashboard
So the address would be https:///www.mysite.com/dashboard
<VirtualHost *:443>
ProxyPreserveHost On
ServerName www.mysite.com
ProxyPass /dashboard http://1.2.3.4:2000
ProxyPassReverse /dashboard http://1.2.3.4:2000
</VirtualHost>
The dashboard.ps1 is simple:
Import-Module UniversalDashboard.Community;
Enable-UDLogging -Console -Level Info
Start-UdDashboard -Content {
New-UdDashboard -Title "Server Performance Dashboard" -Color '#FF050F7F' -Content {
New-UDCard -Title "Home" -Content {
"Welcome, this is my homepage (Steven Spierenburg)"
}
} } -Port 2000 -Wait
Running it locally or from a PC that can connect to it, it will work
As you can see, it runs on port 2000
But when running it via a reverse proxy it fails
This is what the console tells me when I try to connect to the dashboard:
Now listening on: http://0.0.0.0:2000
Application started. Press Ctrl+C to shut down.
23:21:51 [Info] Microsoft.AspNetCore.Hosting.Internal.WebHost Request starting HTTP/1.1 GET http://www.mysite.com/
23:21:51 [Info] Microsoft.AspNetCore.Hosting.Internal.WebHost Request finished in 8.2584ms 200 text/html; charset=utf-8
A very quick and short response. When connecting locally the output is much larger/more lines.
But it shows that something is arriving at UD
However, I get a blank page. When I try with Developer tools to investigate I see this:
GET https://www.mysite.com/main.ec3003e4009bbf28a5cb.bundle.js net::ERR_ABORTED 404 (Not Found)
As you can see, no/dashboard
is present anymore
When I change the URL to have that like so:
https://www.mysite.com/dashboard/main.ec3003e4009bbf28a5cb.bundle.js
The page/JS loads in the browser (shows the javascript code)
The page that shows blank is having this content:
<!DOCTYPE html>
<html>
<head>
<base href="[/](https://www.mysite.com/)"/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PowerShell Universal Dashboard</title>
<style>
.v-wrap{
height: 100% !important;
white-space: nowrap !important;
text-align: center !important;
display: block !important;
min-height: auto !important;
flex-direction: row !important;
}
.v-wrap:before{
content: "";
display: inline-block;
vertical-align: middle;
width: 0;
/* adjust for white space between pseudo element and next sibling */
margin-right: -.25em;
/* stretch line height */
height: 100vh;
}
.v-box{
display: inline-block;
vertical-align: middle;
white-space: normal;
}
</style>
<link rel="shortcut icon" href="[favicon.ico](https://www.mysite.com/favicon.ico)"></head>
<body>
<div id="app" class="app"/>
<script type="text/javascript" src="[main.ec3003e4009bbf28a5cb.bundle.js](https://www.mysite.com/main.ec3003e4009bbf28a5cb.bundle.js)"></script><script type="text/javascript" src="[vendor.ec3003e4009bbf28a5cb.bundle.js](https://www.mysite.com/vendor.ec3003e4009bbf28a5cb.bundle.js)"></script></body>
</html>
Does anyone know what could be wrong here?