Open pizzaandcheese opened 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.
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.
Issue is now considered stale. If you want to keep it open, please comment :+1:
Please continue to consider.
just had to enter a large range manually, this would be an amazing feature to have.
I would like to see this added as well.
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....
looking forward to have this functionalitiy
this would be amazing to have, it's a real pain to have to enter each port of a large range individually.
Any news ?
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 :)
@gr33k have you found a work around? im on the same boat trying to open many udp ports fora pbx.
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.