0

I have an Nginx server in Ubuntu 20, And has a multi-port listener on it for the proxy pass.

I want to limit the number of connections per port. IP doesn't matter (I mean dont limit by IP). My IPTable has been disabled and I prefer to dont use it. I want way to limit connection event without Nginx but the Nginx limit is ok too.

There is a way to limit that without lose performance ?

Update : I found CSF Firewall can manegment this but there is easier way to Im locking for?

Mohsen
  • 103
  • 5
  • 1
    What are you planning to do with the connections that exceed the limit? Easiest is to drop them, in which case the firewall way of limiting is certainly looks the most straightforward. The "CSF firewall" is nothing more that the script which uses iptables under the hood, but it is definitely much more hassle than write just one iptables command. In general, if you are in Linux and want to use the firewall, you won't be able to avoid using Netfilter, either with iptables or nftables. Finally, I've found [your question answered](https://access.redhat.com/solutions/396273). – Nikita Kipriyanov Oct 24 '22 at 05:26
  • @NikitaKipriyanov Thank you, that so good answer – Mohsen Oct 24 '22 at 13:13
  • @NikitaKipriyanov The suggested answer limits the number of connections per IP, not the total number of connections. – x-yuri Aug 06 '23 at 13:28
  • @x-yuri if you really understand the answer in the link, you should be able to figure out the additional parameter to get it working as intended. – A.B Aug 06 '23 at 16:31
  • @A.B One might say, if you know what `iptables` is you should be able to figure out how to achieve the goal. Anyways, I've found [the question answered](https://serverfault.com/a/547317/162443). – x-yuri Aug 08 '23 at 11:55

0 Answers0