Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Changing the Default Ports; Currently Blocks Host Networking #4122

Open
mtwo opened this issue Oct 30, 2024 · 0 comments
Open

Allow Changing the Default Ports; Currently Blocks Host Networking #4122

mtwo opened this issue Oct 30, 2024 · 0 comments

Comments

@mtwo
Copy link

mtwo commented Oct 30, 2024

I've seen several issues in this repository that request the ability to change the default listen ports for HTTP and HTTPS traffic, however most of these are solvable by configuring the correct bridge ports in Docker or Kubernetes.

However, there is a use case for NPM that requires changing the ports within the container: host networking. Host networking offers significant performance improvements over bridge networking, as the Docker runtime doesn't have to handle any of the incoming or outgoing network traffic from the application. It is often recommended for network proxies like Nginx for this reason, and there are some compelling benchmarks of the performance differences.

Unfortunately, Docker host networking removes the ability for Docker to remap ports, meaning that the default ports of the application inside of the container are used instead. This causes issues in Docker environments were ports 80 and 443 are already used by the host operating system or other applications, which is the case for TrueNAS and several others: truenas/apps#734

Being able to set the Nginx listen and web UI ports via an environment variable or some other mechanism would allow users in any Docker environment to gain the performance benefits of using the host network driver.

snordmann added a commit to snordmann/nginx-proxy-manager that referenced this issue Oct 31, 2024
I have seen a few issues that mention that changing the port that nginx
listens on is important (especially when using hostNetwork).

I am not totally convinced that NPM should allow these use-cases but I
was bored enough to implement it anyway.

Related Issue: NginxProxyManager#4122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant