add favicon

This commit is contained in:
2026-05-07 23:24:46 +03:30
parent 01e8711329
commit a9f237da8b
8 changed files with 19 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nginx Monitor</title> <title>Nginx Monitor</title>
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%230b0f14'/%3E%3Ccircle cx='32' cy='32' r='24' fill='%23111821' stroke='%23263344' stroke-width='3'/%3E%3Cpath d='M14 36h9l5-18 8 30 5-16h9' fill='none' stroke='%2345d4d0' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17 20h30' fill='none' stroke='%2345d483' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E">
<style> <style>
:root { :root {
color-scheme: dark; color-scheme: dark;

BIN
assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

6
assets/favicon.svg Normal file
View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
<rect width="64" height="64" rx="14" fill="#0b0f14"/>
<circle cx="32" cy="32" r="24" fill="#111821" stroke="#263344" stroke-width="3"/>
<path d="M14 36h9l5-18 8 30 5-16h9" fill="none" stroke="#45d4d0" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17 20h30" fill="none" stroke="#45d483" stroke-width="4" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 434 B

View File

@@ -77,6 +77,7 @@ RUN apt-get update \
COPY --from=builder /usr/local/nginx /usr/local/nginx COPY --from=builder /usr/local/nginx /usr/local/nginx
COPY --from=builder /usr/local/sbin/nginx /usr/local/sbin/nginx COPY --from=builder /usr/local/sbin/nginx /usr/local/sbin/nginx
COPY assets/favicon.ico /usr/local/nginx/html/favicon.ico
COPY dockerized/nginx.conf /etc/nginx/nginx.conf COPY dockerized/nginx.conf /etc/nginx/nginx.conf
EXPOSE 8080 EXPOSE 8080

View File

@@ -54,6 +54,7 @@ sh dockerized/test.sh
- Nginx binary: `/usr/local/sbin/nginx` - Nginx binary: `/usr/local/sbin/nginx`
- Module: `/usr/local/nginx/modules/ngx_http_monitoring_module.so` - Module: `/usr/local/nginx/modules/ngx_http_monitoring_module.so`
- Config: `/etc/nginx/nginx.conf` - Config: `/etc/nginx/nginx.conf`
- Favicon: `/usr/local/nginx/html/favicon.ico`, served at `/favicon.ico`
- Listen port: `8080` - Listen port: `8080`
The supplied `nginx.conf` enables: The supplied `nginx.conf` enables:

View File

@@ -44,6 +44,13 @@ http {
monitor_cors "*"; monitor_cors "*";
} }
location = /favicon.ico {
root /usr/local/nginx/html;
default_type image/x-icon;
access_log off;
add_header Cache-Control "public, max-age=86400";
}
location = / { location = / {
default_type text/plain; default_type text/plain;
return 200 "ngx_http_monitoring_module docker image\nopen /monitor for the dashboard\n"; return 200 "ngx_http_monitoring_module docker image\nopen /monitor for the dashboard\n";

View File

@@ -4,6 +4,7 @@ set -eu
BASE_URL="${BASE_URL:-http://127.0.0.1:8080}" BASE_URL="${BASE_URL:-http://127.0.0.1:8080}"
curl -fsS "$BASE_URL/" >/dev/null curl -fsS "$BASE_URL/" >/dev/null
curl -fsS "$BASE_URL/favicon.ico" >/dev/null
curl -fsS "$BASE_URL/monitor" >/dev/null curl -fsS "$BASE_URL/monitor" >/dev/null
curl -fsS "$BASE_URL/monitor/api" >/dev/null curl -fsS "$BASE_URL/monitor/api" >/dev/null
curl -fsS "$BASE_URL/monitor/api/system" >/dev/null curl -fsS "$BASE_URL/monitor/api/system" >/dev/null

View File

@@ -3,7 +3,8 @@
static const u_char ngx_http_monitoring_dashboard_html[] = static const u_char ngx_http_monitoring_dashboard_html[] =
"<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\">" "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\">"
"<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">" "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">"
"<title>Nginx Monitor</title><style>" "<title>Nginx Monitor</title><link rel=\"icon\" type=\"image/svg+xml\" href=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%230b0f14'/%3E%3Ccircle cx='32' cy='32' r='24' fill='%23111821' stroke='%23263344' stroke-width='3'/%3E%3Cpath d='M14 36h9l5-18 8 30 5-16h9' fill='none' stroke='%2345d4d0' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M17 20h30' fill='none' stroke='%2345d483' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E\">"
"<style>"
":root{color-scheme:dark;--bg:#0b0f14;--panel:#111821;--panel2:#151f2b;--line:#263344;--text:#e6edf3;--muted:#8fa1b3;--green:#45d483;--red:#ff5f6d;--yellow:#f4c95d;--blue:#5aa9ff;--cyan:#45d4d0}" ":root{color-scheme:dark;--bg:#0b0f14;--panel:#111821;--panel2:#151f2b;--line:#263344;--text:#e6edf3;--muted:#8fa1b3;--green:#45d483;--red:#ff5f6d;--yellow:#f4c95d;--blue:#5aa9ff;--cyan:#45d4d0}"
"*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}" "*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}"
"header{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid var(--line);background:#0f151d;position:sticky;top:0;z-index:5}" "header{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid var(--line);background:#0f151d;position:sticky;top:0;z-index:5}"