# NGINX Proxy Manager [0.0.0.0:80/443]

Nginx proxy Manager from [https://nginxproxymanager.com/](https://nginxproxymanager.com/)

- [ ] essential core service which should be configured first
- [ ] requires docker already installed
- [ ] exposes open ports on the main server public IP 
    - [ ] Port 80 listens and if matched to a valid hostname or wildcard, routes the traffic; all http should simply redirect to https
    - [ ] Port 443 listens and routes traffic dependiong on hostnames 
        - [ ] \*.pknw1.co.uk domains are uysd for publicly accessible services
        - [ ] \*.admin.pknw1.co.uk domains are used for restricted access services
        - [ ] routed to an appropriate proxy host configuration based on DNS name
        - [ ] the FQDN SSL connection is verified against the system wide wildcard cert for either *.pknw1.co.uk or* .admin.pknw1.co.uk

tcp 0 0 149.202.72.112:80 0.0.0.0:\* LISTEN 948505/docker-proxy   
tcp 0 0 149.202.72.112:443 0.0.0.0:\* LISTEN 948532/docker-proxy

<table border="1" id="bkmrk-named-proxy-hosts-in" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>Named Proxy Hosts in NGINX</td><td>catch any \*.pknw1.co.uk</td><td>catch \*.admin.pknw1.co.uk</td></tr><tr><td>The preferred method of routing is by matching the request wirh the appropriate wildcard domain configuration

all wildcard matches are validated against any access rules and then passed through to the nginx proxy which directs the request to the configuired container

This setuop allows the domain config to be done with the service container environment variables in an automated way rather than manually setting a proxy host and reverese proxy config for each new service

</td><td>passed to the backend and routed via internal proxy;

a manual config can also be added and further restricted

all public containers should be on the proxy docker network

172.22.20.1

</td><td>matched as a wildcard for the admin domain

before passing to the internal\_proxy for hostname based routing, the source of the session is determined

as this is admin only - only over tailscale, we configure any source with a local docker address 172.22.0.0/16 or from the Tailscale network 100.100.69.0/24 it is allowed

any non matches are deny;

</td></tr><tr><td>  
</td><td>  
</td><td>  
</td></tr></tbody></table>

**Example wildcard proxy configuration for \*.pknw1.co.uk**

<table border="1" id="bkmrk-" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25%;"></col><col style="width: 25%;"></col><col style="width: 25%;"></col><col style="width: 25%;"></col></colgroup><tbody><tr><td>[![Screenshot 2025-06-21 at 21.22.04.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-22-04.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-22-04.png)</td><td>[![Screenshot 2025-06-21 at 21.22.28.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-22-28.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-22-28.png)</td><td>[![Screenshot 2025-06-21 at 21.23.04.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-23-04.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-23-04.png)</td><td>[![Screenshot 2025-06-21 at 21.22.49.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-22-49.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-22-49.png)</td></tr></tbody></table>

**Example wildcard proxy configuration for \*.admin.pknw1.co.uk**

<table border="1" id="bkmrk--1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25%;"></col><col style="width: 25%;"></col><col style="width: 25%;"></col><col style="width: 25%;"></col></colgroup><tbody><tr><td>[![Screenshot 2025-06-21 at 21.29.57.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-29-57.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-29-57.png)</td><td>[![Screenshot 2025-06-21 at 21.30.16.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-30-16.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-30-16.png)</td><td>[![Screenshot 2025-06-21 at 21.30.27.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-30-27.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-30-27.png)</td><td>[![Screenshot 2025-06-21 at 21.30.36.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-21-30-36.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-21-30-36.png)</td></tr></tbody></table>

<details id="bkmrk-nginx-proxy-manager--1"><summary>nginx proxy manager proxy host config files on disk</summary>

`cd /etc/pknw1/config/core-system/nginx_proxy_manager/data/nginx/proxy_host`

`for f in $(ls *conf); do DOM=$(head -n2 $f | tail -n1); FN=$(echo $f | awk -F. '{print $1}'); echo $FN $DOM | sed 's/#//'; done`

`1  *.pknw1.co.uk`  
`10  dev.pknw1.co.uk, yt-dev.pknw1.co.uk`  
`12  search.pknw1.co.uk`  
`15  mobile.engineering.pknw1.co.uk`  
`16  webmin.pknw1.co.uk`  
`18  engineering.pknw1.co.uk`  
`2  *.admin.pknw1.co.uk`  
`23  admin.pknw1.co.uk`  
`25  jackett.pknw1.co.uk`  
`26  *.streaming-from.cloud, streaming-from.cloud`  
`28  accounts.pknw1.co.uk, my.pknw1.co.uk`  
`3  webmin.admin.pknw1.co.uk`  
`31  check.pknw1.co.uk`  
`32  notflix.pknw1.co.uk, test.pknw1.co.uk`  
`33  requests.pknw1.co.uk`  
`35  tv.pknw1.co.uk`  
`36  jf.pknw1.co.uk`  
`37  hub.pknw1.co.uk`  
`38  ut.admin.pknw1.co.uk, utorrent.admin.pknw1.co.uk`  
`41  404.pknw1.co.uk`  
`42  reddit_webhook.pknw1.co.uk, webhook.pknw1.co.uk`  
`43  vue.pknw1.co.uk`  
`6  login.pknw1.co.uk`

</details>**The folllowing manual configurations are required for mapping non-docker services via the proxy**

<table border="1" id="bkmrk-service-name-externa" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><thead><tr><td>**Service Name**</td><td>**External URL**</td><td>**Mapped Service**</td></tr></thead><tbody><tr><td>Webmin</td><td>https://webmin.admin.pknw1.co.uk</td><td>`http port 80 -> 443`

`443 -> webmin proxy host config`

`SSL cert validated *.admin.pknw1.co.uk`

`source checked via advanced config`

`if allowed, direct the connection`

`NPM -> proxy docker network -> 10000`

</td></tr><tr><td>  
</td><td>  
</td><td>  
</td></tr><tr><td>  
</td><td>  
</td><td>  
</td></tr></tbody></table>

####  

#### pre-installation

- [ ] docker must be installed and running
- [ ] docker compose must be installed and available
- [ ] docker networks need to be configured 
    - [ ] proxy 172.22.20.0/24
    - [ ] admin 172.22.22.0/24
- [ ] host networks need to be configured 
    - [ ] public IP 149.202.72.112/32
    - [ ] tailscale IP 100.100.69.2
    - [ ] internal\_proxy is required for DNS routed access to teh admin URL

- [ ] the folders for the core-system group of containers is required /etc/pknw1.services/core-services/ for the docker-compose.yml file
- [ ] the folders for the application persistence are required /etc/pknw1.config/core-system.nginx\_proxy\_manager
- [ ] any other included file locations muist exist before start

####  

#### Installation

as nginx proxy manager runs in a container under docker, "installation" requires

1. the docker compose file modiofied for this server
2. the contaner config folders and eother a blank start or restored config files from backup

<details id="bkmrk-npm_preinstall_check"><summary>npm\_preinstall\_checks.sh</summary>

<div style="color: #cccccc; background-color: #1f1f1f; font-family: Menlo, Monaco, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 18px; white-space: pre;"><div><span style="color: #6a9955;">\#!/bin/bash -e</span></div><div><span style="color: #6a9955;">\# pre-install script for nginx\_proxy\_manager deployment under docker</span></div><div><span style="color: #6a9955;">\# \[X\] Checks docker and docker compose available</span></div><div><span style="color: #6a9955;">\# \[X\] Checks required networks are available</span></div><div><span style="color: #6a9955;">\# \[X\] Checks compose and config folders are available</span></div><div><span style="color: #6a9955;">\#</span></div>  
<div><span style="color: #dcdcaa;">which</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">docker</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"docker installed"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> ( </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"docker is required - please install"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">exit</span><span style="color: #cccccc;"> </span><span style="color: #b5cea8;">255</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #dcdcaa;">docker</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">compose</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">version</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> ( </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"docker compose is not available - please install"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">exit</span><span style="color: #cccccc;"> </span><span style="color: #b5cea8;">255</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #dcdcaa;">docker</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">network</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">inspect</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">proxy</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> ( </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"docker network: proxy missing"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">exit</span><span style="color: #cccccc;"> </span><span style="color: #b5cea8;">255</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #dcdcaa;">docker</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">network</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">inspect</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">admin</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> ( </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"docker network: admin missing"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">exit</span><span style="color: #cccccc;"> </span><span style="color: #b5cea8;">255</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #dcdcaa;">ip</span><span style="color: #cccccc;"> </span><span style="color: #569cd6;">-4</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">a</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">|</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">grep</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"149.202.72.112"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> ( </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"public IP not available"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">exit</span><span style="color: #cccccc;"> </span><span style="color: #b5cea8;">255</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #dcdcaa;">ip</span><span style="color: #cccccc;"> </span><span style="color: #569cd6;">-4</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">a</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">|</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">grep</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"100.100.69.2"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> (</span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"tailscale IP not available"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">exit</span><span style="color: #cccccc;"> </span><span style="color: #b5cea8;">255</span><span style="color: #cccccc;"> )</span></div>  
<div><span style="color: #cccccc;">\[ </span><span style="color: #d4d4d4;">-d</span><span style="color: #cccccc;"> /etc/pknw1/services/core-system \] &amp;&amp; </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"compose folder exists"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> (</span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"creating compose folder"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">mkdir</span><span style="color: #cccccc;"> </span><span style="color: #569cd6;">-p</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">/etc/pknw1/services/core-system</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #cccccc;">\[ </span><span style="color: #d4d4d4;">-f</span><span style="color: #cccccc;"> /etc/pknw1/services/core-system/docker-compose.yml \] &amp;&amp; </span><span style="color: #dcdcaa;">grep</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">jc21/nginx-proxy-manager</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">/etc/pknw1/services/core-system/docker-compose.yml</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"configured"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"need to config"</span></div>  
<div><span style="color: #cccccc;">\[ </span><span style="color: #d4d4d4;">-d</span><span style="color: #cccccc;"> /etc/pknw1/config/core-system/nginx\_proxy\_manager \] &amp;&amp; </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"config folder exists"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> (</span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"creating config folder"</span><span style="color: #cccccc;"> &amp;&amp; </span><span style="color: #dcdcaa;">mkdir</span><span style="color: #cccccc;"> </span><span style="color: #569cd6;">-p</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">/etc/pknw1/config/core-system/nginx\_proxy\_manager</span><span style="color: #cccccc;"> )</span></div><div><span style="color: #cccccc;">\[ </span><span style="color: #d4d4d4;">-d</span><span style="color: #cccccc;"> /etc/pknw1/config/core-system/nginx\_proxy\_manager/data \] &amp;&amp; </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"configuration data exists"</span><span style="color: #cccccc;"> </span><span style="color: #d4d4d4;">||</span><span style="color: #cccccc;"> </span><span style="color: #dcdcaa;">echo</span><span style="color: #cccccc;"> </span><span style="color: #ce9178;">"no configuration detected - setting up fresh"</span></div>  
</div></details><details id="bkmrk-%2Fetc%2Fpknw1%2Fservices%2F"><summary>/etc/pknw1/services/core-system/docker-compose.yml</summary>

<div style="color: #cccccc; background-color: #1f1f1f; font-family: Menlo, Monaco, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 18px; white-space: pre;"><div><span style="color: #569cd6;">services</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">nginx\_proxy\_manager</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">image</span><span style="color: #cccccc;">: </span><span style="color: #ce9178;">jc21/nginx-proxy-manager:latest</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">restart</span><span style="color: #cccccc;">: </span><span style="color: #ce9178;">unless-stopped</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">ports</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">149.202.72.112:80:80</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">149.202.72.112:443:443</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:80:80</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:443:443</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:81:81</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:3389:3389</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:3128:3128</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:53:53</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">100.100.69.2:3129:3129</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">172.22.20.1:80:80</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">privileged</span><span style="color: #cccccc;">: </span><span style="color: #569cd6;">true</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">volumes</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">/etc/pknw1/config/core-system/nginx\_proxy\_manager/98-themepark:/etc/cont-init.d/99-themepark</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">/etc/pknw1/config/core-system/nginx\_proxy\_manager/data:/data</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">/etc/pknw1/config/core-system/nginx\_proxy\_manager/data/override/conf.d:/etc/nginx/conf.d</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">/etc/pknw1/config/core-system/nginx\_proxy\_manager/data/override/templates:/app/templates</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">/etc/pknw1/config/core-system/nginx\_proxy\_manager/letsencrypt:/etc/letsencrypt</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">labels</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">"com.centurylinklabs.watchtower.enable=true"</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">container\_name</span><span style="color: #cccccc;">: </span><span style="color: #ce9178;">nginx\_proxy\_manager</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">dns</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">8.8.8.8</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">172.22.20.1</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">hostname</span><span style="color: #cccccc;">: </span><span style="color: #ce9178;">proxymanager</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">networks</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">proxy</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">admin</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">environment</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">PUID=0</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">PGID=0</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">VIRTUAL\_HOST=proxymanager.admin.pknw1.co.uk</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">VIRTUAL\_PORT=81</span></div><div><span style="color: #cccccc;"> - </span><span style="color: #ce9178;">VIRTUAL\_PROTO=http</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">healthcheck</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">test</span><span style="color: #cccccc;">: \[</span><span style="color: #ce9178;">"CMD"</span><span style="color: #cccccc;">, </span><span style="color: #ce9178;">"/usr/bin/check-health"</span><span style="color: #cccccc;">\]</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">interval</span><span style="color: #cccccc;">: </span><span style="color: #ce9178;">60s</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">timeout</span><span style="color: #cccccc;">: </span><span style="color: #ce9178;">30s</span></div>  
<div><span style="color: #569cd6;">networks</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">admin</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">external</span><span style="color: #cccccc;">: </span><span style="color: #569cd6;">true</span></div>  
<div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">proxy</span><span style="color: #cccccc;">:</span></div><div><span style="color: #cccccc;"> </span><span style="color: #569cd6;">external</span><span style="color: #cccccc;">: </span><span style="color: #569cd6;">true</span></div>  
</div></details><details id="bkmrk-%2Fetc%2Fpknw1%2Fconfig%2Fco"><summary>/etc/pknw1/config/core-system/nginx\_proxy\_manager</summary>

to be completed

backup and restore of config

</details>```
cd /tmp
vi pre-install
chmod +x pre-install
./pre-install


cd /etc/pknw1/service/core-system
vi docker-cmopose.yml
docker compose config
docker compose pull
docker compose up -d && docker compose logs -f
```

<details id="bkmrk-nginx-proxy-manager--2"><summary>nginx proxy manager typical startup logs (FULL)</summary>

```
--------------------------------------
| Nginx Proxy Manager theme.park Mod |
useradd warning: npm's uid 0 outside of the UID_MIN 1000 and UID_MAX 60000 range.
--------------------------------------
Variables set:
'APP_FILEPATH'=/app/frontend/
'TP_DOMAIN'=
'TP_COMMUNITY_THEME'=
'TP_SCHEME'=
'TP_THEME'=

No domain set, defaulting to theme-park.dev
No scheme set, defaulting to https
No theme set, defaulting to organizr
---------------------------------------
| Adding the stylesheet to html files |
---------------------------------------
Stylesheet set to organizr on /app/frontend/index.html

Stylesheet set to organizr on /app/frontend/login.html

❯ Configuring npm user ...
❯ Configuring npm group ...
❯ Checking paths ...
❯ Setting ownership ...
❯ Dynamic resolvers ...
❯ IPv6 ...
Enabling IPV6 in hosts in: /etc/nginx/conf.d
- /etc/nginx/conf.d/include/resolvers.conf
- /etc/nginx/conf.d/include/ssl-cache-stream.conf
- /etc/nginx/conf.d/include/ssl-ciphers.conf
- /etc/nginx/conf.d/include/ssl-cache.conf
- /etc/nginx/conf.d/include/assets.conf
- /etc/nginx/conf.d/include/ip_ranges.conf
- /etc/nginx/conf.d/include/proxy.conf
- /etc/nginx/conf.d/include/log.conf
- /etc/nginx/conf.d/include/force-ssl.conf
- /etc/nginx/conf.d/include/letsencrypt-acme-challenge.conf
- /etc/nginx/conf.d/include/block-exploits.conf
- /etc/nginx/conf.d/production.conf
- /etc/nginx/conf.d/default.conf
Enabling IPV6 in hosts in: /data/nginx
- /data/nginx/redirection_host/10.conf
- /data/nginx/redirection_host/11.conf
- /data/nginx/redirection_host/7.conf
- /data/nginx/redirection_host/1.conf
- /data/nginx/redirection_host/2.conf
- /data/nginx/redirection_host/8.conf
- /data/nginx/redirection_host/9.conf
- /data/nginx/redirection_host/4.conf
- /data/nginx/custom/root-robots.conf
- /data/nginx/proxy_host/32.conf
- /data/nginx/proxy_host/26.conf
- /data/nginx/proxy_host/10.conf
- /data/nginx/proxy_host/31.conf
- /data/nginx/proxy_host/41.conf
- /data/nginx/proxy_host/38.conf
- /data/nginx/proxy_host/36.conf
- /data/nginx/proxy_host/33.conf
- /data/nginx/proxy_host/15.conf
- /data/nginx/proxy_host/37.conf
- /data/nginx/proxy_host/43.conf
- /data/nginx/proxy_host/3.conf
- /data/nginx/proxy_host/23.conf
- /data/nginx/proxy_host/1.conf
- /data/nginx/proxy_host/12.conf
- /data/nginx/proxy_host/2.conf
- /data/nginx/proxy_host/6.conf
- /data/nginx/proxy_host/16.conf
- /data/nginx/proxy_host/35.conf
- /data/nginx/proxy_host/28.conf
- /data/nginx/proxy_host/42.conf
- /data/nginx/proxy_host/18.conf
- /data/nginx/proxy_host/25.conf
- /data/nginx/default_host/site.conf
- /data/nginx/stream/3.conf
- /data/nginx/stream/1.conf
- /data/nginx/stream/6.conf
- /data/nginx/stream/5.conf
- /data/nginx/stream/4.conf
❯ Docker secrets ...

-------------------------------------
 _   _ ____  __  __
| \ | |  _ \|  \/  |
|  \| | |_) | |\/| |
| |\  |  __/| |  | |
|_| \_|_|   |_|  |_|
-------------------------------------
User:  npm PUID:0 ID:0 GROUP:0
Group: npm PGID:0 ID:0
-------------------------------------

❯ Starting nginx ...
❯ Starting backend ...
[6/21/2025] [7:24:00 PM] [Global   ] › ℹ  info      Using Sqlite: /data/database.sqlite
[6/21/2025] [7:24:04 PM] [Migrate  ] › ℹ  info      Current database version: none
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-3' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endpo
int = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-3' && chmod 600 '/etc/letsencrypt/credentials/credentials-3'; }
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-4' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endpo
int = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-4' && chmod 600 '/etc/letsencrypt/credentials/credentials-4'; }
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-5' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endpo
int = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-5' && chmod 600 '/etc/letsencrypt/credentials/credentials-5'; }
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-8' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endpo
int = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-8' && chmod 600 '/etc/letsencrypt/credentials/credentials-8'; }
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-9' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endpo
int = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-9' && chmod 600 '/etc/letsencrypt/credentials/credentials-9'; }
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-11' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endp
oint = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-11' && chmod 600 '/etc/letsencrypt/credentials/credentials-11'; }
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: [ -f '/etc/letsencrypt/credentials/credentials-12' ] || { mkdir -p /etc/letsencrypt/credentials 2> /dev/null; echo 'dns_ovh_endp
oint = ovh-eu
dns_ovh_application_key  = cb81d5c8327179df 
dns_ovh_application_secret  = f0893715412c7a54752c89441c9c5cf4
dns_ovh_consumer_key  = c14b3c1e4723d77e341c5d7499b2a76c' > '/etc/letsencrypt/credentials/credentials-12' && chmod 600 '/etc/letsencrypt/credentials/credentials-12'; }
[6/21/2025] [7:24:04 PM] [Certbot  ] › ▶  start     Installing ovh...
[6/21/2025] [7:24:04 PM] [Global   ] › ⬤  debug     CMD: . /opt/certbot/bin/activate && pip install --no-cache-dir acme==$(certbot --version | grep -Eo '[0-9](\.[0-9]+)+') certbot-dns-o
vh==$(certbot --version | grep -Eo '[0-9](\.[0-9]+)+')  && deactivate
[6/21/2025] [7:24:10 PM] [Certbot  ] › ☒  complete  Installed ovh
[6/21/2025] [7:24:10 PM] [Setup    ] › ℹ  info      Added Certbot plugins ovh
[6/21/2025] [7:24:10 PM] [Setup    ] › ℹ  info      Logrotate Timer initialized
[6/21/2025] [7:24:10 PM] [Global   ] › ⬤  debug     CMD: logrotate /etc/logrotate.d/nginx-proxy-manager
[6/21/2025] [7:24:10 PM] [Setup    ] › ℹ  info      Logrotate completed.
[6/21/2025] [7:24:10 PM] [IP Ranges] › ℹ  info      Fetching IP Ranges from online services...
[6/21/2025] [7:24:10 PM] [IP Ranges] › ℹ  info      Fetching https://ip-ranges.amazonaws.com/ip-ranges.json
[6/21/2025] [7:24:10 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v4
[6/21/2025] [7:24:10 PM] [IP Ranges] › ℹ  info      Fetching https://www.cloudflare.com/ips-v6
[6/21/2025] [7:24:10 PM] [SSL      ] › ℹ  info      Let's Encrypt Renewal Timer initialized
[6/21/2025] [7:24:10 PM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
[6/21/2025] [7:24:10 PM] [IP Ranges] › ℹ  info      IP Ranges Renewal Timer initialized
[6/21/2025] [7:24:10 PM] [Global   ] › ℹ  info      Backend PID 214 listening on port 3000 ...
[6/21/2025] [7:24:10 PM] [SSL      ] › ℹ  info      Completed SSL cert renew process
[6/21/2025] [8:24:10 PM] [SSL      ] › ℹ  info      Renewing SSL certs expiring within 30 days ...
[6/21/2025] [8:24:10 PM] [SSL      ] › ℹ  info      Completed SSL cert renew process
[6/21/2025] [8:44:10 PM] [Global   ] › ⬤  debug     CMD: /usr/sbin/nginx -t -g "error_log off;"
[6/21/2025] [8:44:10 PM] [Nginx    ] › ⬤  debug     Deleting file: /data/nginx/proxy_host/3.conf
[6/21/2025] [8:44:11 PM] [Global   ] › ⬤  debug     CMD: /usr/sbin/nginx -t -g "error_log off;"
[6/21/2025] [8:44:11 PM] [Global   ] › ⬤  debug     CMD: /usr/sbin/nginx -t -g "error_log off;"
[6/21/2025] [8:44:11 PM] [Nginx    ] › ℹ  info      Reloading Nginx
```

</details><details id="bkmrk-nginx-proxy-manager--3"><summary>nginx proxy manager log indicators</summary>

<div style="color: #cccccc; background-color: #1f1f1f; font-family: Menlo, Monaco, 'Courier New', monospace; font-weight: normal; font-size: 12px; line-height: 18px; white-space: pre;"><div><span style="color: rgb(126, 140, 141);">--------------------------------------</span></div><div><span style="color: rgb(126, 140, 141);">| Nginx Proxy Manager theme.park Mod |</span></div><div><span style="color: rgb(126, 140, 141);">useradd warning: npm's uid 0 outside of the UID\_MIN 1000 and UID\_MAX 60000 range.</span></div><div><span style="color: rgb(126, 140, 141);">--------------------------------------</span></div><div><span style="color: rgb(126, 140, 141);">Variables set:</span></div><div><span style="color: rgb(126, 140, 141);">'APP\_FILEPATH'=/app/frontend/</span></div><div><span style="color: rgb(126, 140, 141);">'TP\_DOMAIN'=</span></div><div><span style="color: rgb(126, 140, 141);">'TP\_COMMUNITY\_THEME'=</span></div><div><span style="color: rgb(126, 140, 141);">'TP\_SCHEME'=</span></div><div><span style="color: rgb(126, 140, 141);">'TP\_THEME'=</span></div>  
<div><span style="color: rgb(126, 140, 141);">Enabling IPV6 in hosts in: /data/nginx</span></div><div><span style="color: rgb(126, 140, 141);">❯ Docker secrets ...</span></div>  
<div><span style="color: rgb(126, 140, 141);">-------------------------------------</span></div><div><span style="color: rgb(126, 140, 141);"> \_ \_ \_\_\_\_ \_\_ \_\_</span></div><div><span style="color: rgb(126, 140, 141);">| \\ | | \_ \\| \\/ |</span></div><div><span style="color: rgb(126, 140, 141);">| \\| | |\_) | |\\/| |</span></div><div><span style="color: rgb(126, 140, 141);">| |\\ | \_\_/| | | |</span></div><div><span style="color: rgb(126, 140, 141);">|\_| \\\_|\_| |\_| |\_|</span></div><div><span style="color: rgb(126, 140, 141);">-------------------------------------</span></div><div><span style="color: rgb(126, 140, 141);">User: npm PUID:0 ID:0 GROUP:0</span></div><div><span style="color: rgb(126, 140, 141);">Group: npm PGID:0 ID:0</span></div><div><span style="color: rgb(126, 140, 141);">-------------------------------------</span></div>  
<div><span style="color: rgb(45, 194, 107);">❯ Starting nginx ...</span></div><div><span style="color: rgb(45, 194, 107);">❯ Starting backend ...</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:00 PM\] \[Global \] › ℹ info Using Sqlite: /data/database.sqlite</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:04 PM\] \[Migrate \] › ℹ info Current database version: none</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:04 PM\] \[Global \] › ⬤ debug CMD: \[ -f '/etc/letsencrypt/credentials/credentials-3' \] || { mkdir -p /etc/letsencrypt/credentials 2&gt; /dev/null; echo 'dns\_ovh\_endpo</span></div><div><span style="color: rgb(126, 140, 141);">int = ovh-eu</span></div><div><span style="color: rgb(126, 140, 141);">dns\_ovh\_application\_key = cb81d5c8327179df </span></div><div><span style="color: rgb(126, 140, 141);">dns\_ovh\_application\_secret = f0893715412c7a54752c89441c9c5cf4</span></div><div><span style="color: rgb(126, 140, 141);">dns\_ovh\_consumer\_key = c14b3c1e4723d77e341c5d7499b2a76c' &gt; '/etc/letsencrypt/credentials/credentials-3' &amp;&amp; chmod 600 '/etc/letsencrypt/credentials/credentials-3'; }</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[Certbot \] › ☒ complete Installed ovh</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[Setup \] › ℹ info Added Certbot plugins ovh</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[Setup \] › ℹ info Logrotate Timer initialized</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[Global \] › ⬤ debug CMD: logrotate /etc/logrotate.d/nginx-proxy-manager</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[Setup \] › ℹ info Logrotate completed.</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[IP Ranges\] › ℹ info Fetching IP Ranges from online services...</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[IP Ranges\] › ℹ info Fetching https://ip-ranges.amazonaws.com/ip-ranges.json</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[IP Ranges\] › ℹ info Fetching https://www.cloudflare.com/ips-v4</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[IP Ranges\] › ℹ info Fetching https://www.cloudflare.com/ips-v6</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[SSL \] › ℹ info Let's Encrypt Renewal Timer initialized</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[SSL \] › ℹ info Renewing SSL certs expiring within 30 days ...</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[IP Ranges\] › ℹ info IP Ranges Renewal Timer initialized</span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[7:24:10 PM\] \[Global \] › ℹ info <span style="color: rgb(45, 194, 107);">**Backend PID 214 listening on port 3000 ...**</span></span></div><div><span style="color: rgb(126, 140, 141);">\[6/21/2025\] \[8:44:11 PM\] \[Nginx \] › ℹ <span style="color: rgb(45, 194, 107);">info Reloading Nginx</span></span></div></div></details>NGINX Proxy Manager should now be accesible via the admin port (81) on the internal tailscale IP address

#### Admin console

[![Screenshot 2025-06-21 at 22.41.58.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-22-41-58.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-22-41-58.png)

##### Wildcard Domains Proxy Host Setup

##### Wildcard Domains SSL Certs via Letsencrypt using DNS Challenge

<table border="1" id="bkmrk--3" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>  
</td><td>[![Screenshot 2025-06-21 at 22.43.32.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/scaled-1680-/screenshot-2025-06-21-at-22-43-32.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2025-06/screenshot-2025-06-21-at-22-43-32.png)</td></tr></tbody></table>