nginx container to proxy and some visual tweaks

This commit is contained in:
2025-11-30 23:32:53 -08:00
parent 96e874239a
commit 4096f7165c
7 changed files with 78 additions and 12 deletions

View File

@ -29,11 +29,12 @@ function fetchSSDData() {
</head>
<body>
<div class="container">
<button onclick="window.location.reload();" class="title-button"><h1>SSD Health Dashboard</h1></button><p>
This lists every disk ever scanned by this device.<br>
<?php
echo "For a live dashboard, please visit <a href=http://{$_SERVER['HTTP_HOST']}:3000/>this link</a>.<p>";
<button onclick="window.location.reload();" class="title-button"><h2>SSD Health Dashboard</h2></button><br>
This is a historical list of every disk ever scanned by this device.<p>
For a live dashboard, please visit <a href=/>home</a>.
</div>
<div class="container">
<?php
$ssdData = fetchSSDData(); // Fetch data from the API
// Start the table
echo '<table class="ssd-list" style="border-collapse:collapse;width:100%;">';

View File

@ -16,12 +16,10 @@ body {
background-color: #34495e;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}

39
files/nginx/nginx.conf Normal file
View File

@ -0,0 +1,39 @@
# nginx.conf
# This file will be mounted into /etc/nginx/conf.d/default.conf inside the container
# Enable proxy buffers (optional but recommended)
proxy_buffering on;
proxy_buffers 16 16k;
proxy_buffer_size 32k;
server {
listen 80;
server_name localhost;
# --------------------------------------------------------------------
# Proxy everything under "/" to the Node backend
# --------------------------------------------------------------------
location / {
proxy_pass http://172.17.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# --------------------------------------------------------------------
# Proxy everything under "/history" to the Apache backend
# --------------------------------------------------------------------
location /history/ {
proxy_pass http://172.17.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Optional: If you want `/history` (without trailing slash) to be
# redirected to `/history/`:
location = /history {
return 301 /history/;
}
}

View File

@ -8,6 +8,11 @@
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h2>Live Dashboard</h2>
This dashboard shows the currently attached drives along with their health status.<p>
For a history of all drives attached, you can visit <a href=/history>here</a>.
</div>
<div class="container">
<h2>Attached Disks</h2>
<div id="disk_table" class="column">Connecting…</div>