Adminoberflaeche erreichbar machen - ueber einen Namen oder ueber die Wurzel
Unter einem Unterpfad wie /npm bleibt die Oberflaeche des Proxy Managers
weiss. Sie ist eine Single-Page-Anwendung und laedt ihre Dateien ueber
absolute Pfade; nur die Startseite kommt an, alles Weitere landet bei
dem, was auf der Wurzel liegt. An einem laufenden Proxy Manager
gemessen: /npm liefert 200, /images/... dagegen 502. Checkmk funktioniert
unter /cmk/ nur deshalb, weil es fuer einen URL-Praefix gebaut ist.
"proxy admin" kann beides, und beides kommt mit dem einen freien Port
aus:
proxy admin --domain npm.example.local
Eigener Proxy-Host, Oberflaeche auf "/". Welcher Server-Block
greift, entscheidet der Name (SNI), nicht der Port. Setzt
Namensaufloesung voraus - notfalls eine Zeile in der hosts-Datei.
proxy admin --root
Ohne Namensaufloesung: die Wurzel zeigt auf die Adminoberflaeche,
das bisherige Ziel wandert auf /<site>. Checkmk belegt ohnehin nur
seinen Site-Pfad.
proxy admin --root --off nimmt das wieder zurueck
proxy admin zeigt den Stand
Beide Wege sind ueber die IP ohne SNI durchgemessen: Startseite,
/images, /login und die Anmeldung per POST /api/tokens antworten mit
200. In der Oberflaeche liegt das unter Proxy-Hosts >
"Adminoberflaeche erreichbar machen".
Dabei ist ein aelterer Fehler aufgefallen: "die" ruft exit auf, und die
Oberflaeche ruft cmd_* direkt auf - ein Fehlerfall beendete damit die
ganze Oberflaeche, statt ihn anzuzeigen. Betraf auch bestehende
Menuepunkte wie "Einzelheiten eines Proxy-Hosts" (stirbt bei unbekanntem
Namen) und die Jobliste. Alle 24 Aufrufe laufen jetzt in einer Subshell.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1226,6 +1226,7 @@ HTTPS, enables HTTP/2 and websockets, and sets the recommended
|
||||
| `proxy edit --id N …` | change an existing proxy host – only the fields you name |
|
||||
| `proxy default --domain X` | enable HTTPS on the bare IP (mirrors X into a default server) |
|
||||
| `proxy default --off` | remove that mirror again |
|
||||
| `proxy admin --domain X` / `--root` | make the admin interface reachable – by name or via the root |
|
||||
| `proxy reload` | make nginx re-read its configuration – without interruption |
|
||||
| `proxy restart` | restart the Proxy Manager container |
|
||||
|
||||
@@ -1601,6 +1602,72 @@ longer, and a "done" would otherwise be a lie.
|
||||
The GUI has both under **Proxy-Hosts → Proxy Manager neu starten / nginx neu
|
||||
laden**.
|
||||
|
||||
### 10.11 Making the Proxy Manager's admin interface reachable
|
||||
|
||||
It is a single-page application and loads its files over **absolute** paths:
|
||||
|
||||
```html
|
||||
<link rel="preload" href="/images/logo-no-text.svg" ...>
|
||||
```
|
||||
|
||||
Under a sub-path such as `/npm` only the start page arrives; everything else
|
||||
lands on whatever sits at the root – a **blank page** in the browser. Measured
|
||||
against a running Proxy Manager:
|
||||
|
||||
| Access | `/` | `/images/…` | login (`POST /api/tokens`) |
|
||||
|---|---|---|---|
|
||||
| sub-path `/npm` | 200 | **502** | – |
|
||||
| own name | 200 | 200 | 200 |
|
||||
| root | 200 | 200 | 200 |
|
||||
|
||||
Checkmk works under `/cmk/` only because it is built for a URL prefix and puts
|
||||
it into every address it generates. The Proxy Manager cannot do that. Two ways
|
||||
remain – **both work with the single free port**:
|
||||
|
||||
**Option A – own name** (if name resolution exists):
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh proxy admin --domain npm.example.local
|
||||
./scripts/cmk-manage.sh proxy reload
|
||||
```
|
||||
|
||||
Creates a proxy host pointing at `127.0.0.1:81` – the interface sits at `/`
|
||||
there and everything works. Checkmk stays reachable under its own name or the
|
||||
IP; which server block applies is decided by the name (SNI), not the port.
|
||||
Without DNS, one line in the workstations' `hosts` file is enough.
|
||||
|
||||
**Option B – root** (if there is *no* name resolution):
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh proxy admin --root
|
||||
./scripts/cmk-manage.sh proxy default --domain <name> --restart # if set up
|
||||
```
|
||||
|
||||
The root of the existing proxy host then points at the admin interface, and the
|
||||
previous target moves to `/cmk` (or `CMK_SITE_ID`):
|
||||
|
||||
```
|
||||
https://172.0.250.82/ Proxy Manager admin interface
|
||||
https://172.0.250.82/cmk/ Checkmk
|
||||
```
|
||||
|
||||
This works because Checkmk only occupies its site path – the rest of the root
|
||||
is free. To undo:
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh proxy admin --root --off
|
||||
```
|
||||
|
||||
> With option B the **login form is exposed to the network**. For the duration
|
||||
> of a setup that is acceptable; afterwards either undo it or restrict access
|
||||
> to the administration network with the firewall.
|
||||
|
||||
Further options: `--id N` or `--host NAME` when there are several proxy hosts,
|
||||
`--path /path` for a different site path, `--cert self|letsencrypt|none` with
|
||||
option A. Without arguments `proxy admin` shows the current state.
|
||||
|
||||
The GUI has both under **Proxy-Hosts → Adminoberfläche erreichbar machen**.
|
||||
|
||||
---
|
||||
|
||||
## 11. Configuring the Proxy Manager locally (terminal browser)
|
||||
|
||||
Reference in New Issue
Block a user