[PR #5212] Feat: allow user set custom ports for Nginx and Web UI #4092

Open
opened 2026-02-26 08:33:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/5212
Author: @beniamin
Created: 1/23/2026
Status: 🔄 Open

Base: developHead: custom-ports


📝 Commits (1)

  • d95863d set custom port trough env variables. sometimes user may need to use host network where some other services may already use 80,443,81 ports

📊 Changes

8 files changed (+94 additions, -12 deletions)

View changed files

📝 backend/internal/nginx.js (+24 -0)
📝 backend/templates/_listen.conf (+6 -6)
📝 backend/templates/default.conf (+3 -3)
📝 backend/templates/letsencrypt-request.conf (+2 -2)
📝 docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/00-all.sh (+2 -1)
docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/60-ports.sh (+40 -0)
📝 docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/70-secrets.sh (+0 -0)
📝 docs/src/advanced-config/index.md (+17 -0)

📄 Description

Latest versions of TrueNAS have been migrated the Apps from k8s to docker and nginx-proxy-manager is the recommended way(in multiple discussion) to be used as a proxy for internal applications. For the setup to be secure and Nginx-proxy-manager to properly forward the traffic to the internal apps, it must be deployed using host_network options.

There are several issues on TrueNAS Apps Catalog repo([Enhancement]: Nginx Proxy Manager - host network and Allow Host Networking for Nginx Proxy Manager) asking for possibility to set nginx-proxy-manager with host_network, but since 80,443 and 81 ports may conflict with other running services on the server, TrueNAS admin require that nginx-proxy-manager should have the possibility to to use custom ports instead of default ones.

This PR change current behavior and adds option for default ports to be changed trough HTTP_PORT, HTTPS_PORT and WEB_UI_PORT environment variables.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NginxProxyManager/nginx-proxy-manager/pull/5212 **Author:** [@beniamin](https://github.com/beniamin) **Created:** 1/23/2026 **Status:** 🔄 Open **Base:** `develop` ← **Head:** `custom-ports` --- ### 📝 Commits (1) - [`d95863d`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/d95863db3240f65c9c87e0fea8cb4150b51d3c91) set custom port trough env variables. sometimes user may need to use host network where some other services may already use 80,443,81 ports ### 📊 Changes **8 files changed** (+94 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/nginx.js` (+24 -0) 📝 `backend/templates/_listen.conf` (+6 -6) 📝 `backend/templates/default.conf` (+3 -3) 📝 `backend/templates/letsencrypt-request.conf` (+2 -2) 📝 `docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/00-all.sh` (+2 -1) ➕ `docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/60-ports.sh` (+40 -0) 📝 `docker/rootfs/etc/s6-overlay/s6-rc.d/prepare/70-secrets.sh` (+0 -0) 📝 `docs/src/advanced-config/index.md` (+17 -0) </details> ### 📄 Description Latest versions of TrueNAS have been migrated the Apps from k8s to docker and nginx-proxy-manager is the recommended way(in multiple discussion) to be used as a proxy for internal applications. For the setup to be secure and Nginx-proxy-manager to properly forward the traffic to the internal apps, it must be deployed using host_network options. There are several issues on TrueNAS Apps Catalog repo([[Enhancement]: Nginx Proxy Manager - host network](https://github.com/truenas/apps/issues/4149) and [Allow Host Networking for Nginx Proxy Manager](https://github.com/truenas/apps/issues/734)) asking for possibility to set nginx-proxy-manager with host_network, but since 80,443 and 81 ports may conflict with other running services on the server, TrueNAS admin require that nginx-proxy-manager should have the possibility to to use custom ports instead of default ones. This PR change current behavior and adds option for default ports to be changed trough HTTP_PORT, HTTPS_PORT and WEB_UI_PORT environment variables. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#4092
No description provided.