How to Use a Reverse Proxy with a Container in Host Network Mode?

0
14
Asked By CuriousCoder42 On

I'm currently using NetAlertX for network scanning, but I've learned that it needs to run in host network mode. I want my Nginx container to route traffic effectively to this NetAlertX container while also ensuring that it can't be accessed directly via IP and port by others. I've already set up an Nginx container for my other applications. Here's my Docker Compose setup for reference. Can anyone suggest how to configure this properly?

1 Answer

Answered By TechieJoe89 On

To route traffic from Nginx to your NetAlertX container, you could do a proxy pass using the Docker host's IP and port. However, if your containers are on the same private network, consider using a bridge network for communication instead. Just keep in mind, blocking direct access to the host's IP and port would require a firewall to restrict access from specific MAC addresses.

NetworkNinja77 -

Just a heads-up, you can't place a container in a bridge network if it's already set to host network mode. Make sure to double-check your setup!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.