NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.43k stars 2.72k forks source link

Stream port ranges #1969

Open pizzaandcheese opened 2 years ago

pizzaandcheese commented 2 years ago

have a simple addition I would like to request. The ability to forward port ranges for streams.

According to the docs for Nginx it should be possible. https://nginx.org/en/docs/stream/ngx_stream_core_module.html#listen Although when I attempt to forward a range in NPM it requires me to input 1 port number and won't accept a range.

sanegaming commented 2 years ago

I am also needing this feature, I have around 4,000 ports I need to setup and doing it one at a time is not really feasible. If anyone has any other work arounds please let me know.

odjhl88 commented 2 years ago

So, I thought I'd have a look at the conf file generated by NPM. In my case I'm using the Alpine script for Proxmox. This puts the conf file in /data/nginx/stream/x.conf . Here's the code ouput for one of the files.

# ------------------------------------------------------------
# <PORT> TCP: 1 UDP: 1
# ------------------------------------------------------------

server {
  listen <PORT>;
listen [::]:<PORT>;

  proxy_pass <FORWARD_IP>:<PORT>;

  # Custom
  include /data/nginx/custom/server_stream[.]conf;
  include /data/nginx/custom/server_stream_tcp[.]conf;
}

server {
  listen <PORT> udp;
listen [::]:<PORT> udp;

  proxy_pass <FORWARD_IP>:<PORT>;

  # Custom
  include /data/nginx/custom/server_stream[.]conf;
  include /data/nginx/custom/server_stream_udp[.]conf;
}

So, I thought in my brilliance, I'd just modify the file with a port range at the end. Aparently, that's not how this works because now NPM doesn't load it's web interface at all. If someone thinks I might be on to something here, feel free to modify my screw up and see if this can be accomplished.

# ------------------------------------------------------------
# <PORT-START>-<PORT-END> TCP: 1 UDP: 1
# ------------------------------------------------------------

server {
  listen <PORT-START>-<PORT-END>;
listen [::]:<PORT-START>-<PORT-END>;

  proxy_pass <FORWARD_IP>:<PORT-START>-<PORT-END>;

  # Custom
  include /data/nginx/custom/server_stream[.]conf;
  include /data/nginx/custom/server_stream_tcp[.]conf;
}

server {
  listen <PORT-START>-<PORT-END> udp;
listen [::]:<PORT-START>-<PORT-END> udp;

  proxy_pass <FORWARD_IP>:<PORT-START>-<PORT-END>;

  # Custom
  include /data/nginx/custom/server_stream[.]conf;
  include /data/nginx/custom/server_stream_udp[.]conf;
}

Thanks in advance.

github-actions[bot] commented 9 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1:

sanegaming commented 9 months ago

Please continue to consider.

scroguard commented 8 months ago

just had to enter a large range manually, this would be an amazing feature to have.

MinisterPhobia commented 6 months ago

I would like to see this added as well.

Beanietech commented 5 months ago

yes honestly please put this in. cause trying to port game servers is a huge pain..... and that is literally our last step before auto deployment servers....

duzhen commented 5 months ago

looking forward to have this functionalitiy

scroguard commented 5 months ago

this would be amazing to have, it's a real pain to have to enter each port of a large range individually.

GamerClassN7 commented 5 months ago

Any news ?

gr33k commented 3 months ago

Trying to setup a stream to forward SIP ports to a PBX - I'd love to be able to add 10,000-20,000 UDP range...but as we all know - currently not possible. Please add this feature :)

iamdagy commented 3 months ago

@gr33k have you found a work around? im on the same boat trying to open many udp ports fora pbx.

Jason733i commented 2 months ago

Would also love this feature!

jsapede commented 1 month ago

would like this too

paulmataruso commented 3 weeks ago

Really would like this feature.

aflorzy commented 1 week ago

This would be a very convenient feature

gr33k commented 6 days ago

Thank you all for requesting this cool feature!!! Sadly - I haven't found a solution yet as the stream is a single port.

Instead - I have two PBX...one with the main portforwards going to it. So I just setup a sip trunk between that PBX and the other one....Perfect? No....remote users can register a phone/softphone to the 2nd PBX - But it works good enough for testing.

I suspect a SBC may be able to address this as well ... but I haven't had the time to explore this yet.