I have a container in which nginx is running and on this container port 80 and 443 are bound
and this container is routing traffic to different containers where the different websites resides , now i want to reject specific public IP access to the proxy container i made some rules in iptables but they are not working not dropping the access of specific IP.
FYI : vm instance is on GCP
OS =debian9
can you please guide me how iptables works in lxc containers
You use a LXD proxy device, which means that the iptables rules have to work before the LXD proxy device receives the network connection.
Do your rules use INPUT? Try with PREROUTING.
Okay, this one is important. AFAIK, GCP gives out a private IP address to your VM.
Try to verify that your iptables rules really work on your workstation. Therefore, you will be confident that you got the correct rules. Tell us the results of this test.