From dbdc812c94f83a472d12953756ab6913d85c5cde Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 16 Mar 2026 15:27:43 -0700 Subject: [PATCH] Document -urlPrefix flag for subdirectory deployment --- Admin-UI.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Admin-UI.md b/Admin-UI.md index b7021ed..8e20e23 100644 --- a/Admin-UI.md +++ b/Admin-UI.md @@ -32,6 +32,7 @@ weed admin [options] | `-adminPassword` | "" | Admin interface password (if empty, auth is disabled) | | `-readOnlyUser` | "" | Read-only user username (optional) | | `-readOnlyPassword` | "" | Read-only user password (optional; requires adminPassword) | +| `-urlPrefix` | "" | URL path prefix for subdirectory deployment (e.g. `/seaweedfs`) | ## Examples @@ -58,6 +59,27 @@ weed admin -port=23646 -masters="localhost:9333" -dataDir="~/seaweedfs-admin" weed admin -adminUser=admin -adminPassword=secret123 -masters="localhost:9333" ``` +### Behind a Reverse Proxy (Subdirectory) + +```bash +# Serve the admin UI under /seaweedfs/ subdirectory +weed admin -masters="localhost:9333" -urlPrefix=/seaweedfs +``` + +With this configuration, the admin UI is accessible at `http://localhost:23646/seaweedfs/admin`. All static assets, API endpoints, navigation links, and session cookies are automatically scoped to the prefix. + +Example nginx reverse proxy configuration: + +```nginx +location /seaweedfs/ { + proxy_pass http://localhost:23646/seaweedfs/; + 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_set_header X-Forwarded-Proto $scheme; +} +``` + ### Production Deployment ```bash @@ -275,6 +297,11 @@ Or with custom port: http://localhost:PORT ``` +If `-urlPrefix` is configured, include the prefix in the URL: +``` +http://localhost:23646/seaweedfs/admin +``` + ### Dashboard (/) The main dashboard provides a comprehensive overview of your SeaweedFS cluster: