NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
21.66k stars 2.5k 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 6 months ago

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

sanegaming commented 5 months ago

Please continue to consider.

scroguard commented 4 months ago

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

MinisterPhobia commented 3 months ago

I would like to see this added as well.

Beanietech commented 2 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 2 months ago

looking forward to have this functionalitiy

scroguard commented 2 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 1 month ago

Any news ?

gr33k commented 1 week 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 1 day ago

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