0

I have a container instance and a virtual machine (linux) in the same vnet on Azure. The container is a web service. The virtual machine also has a public IP address. How can I route all traffic to the virtual machine in a specific port(example: 8080) to the container (so I can public my web service) ?

ktcl
  • 365
  • 6
  • 23

1 Answers1

0

To access the Azure Container Instance that created in the Vnet, I will suggest the Azure Application Gateway. You can create an Azure Application Gateway as the front end with the public IP, and use it to redirect the traffic to the ACI which in the Vnet. Then create a backend for the application gateway to the ACI private IP.

The application gateway backend pool would like this:

enter image description here

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • I tried and it works even it's pretty complicated. I also figure out why my nginx on the virtual machine doesn't work, that's because the SELinux. Turn it off and we can use nginx as a reverse proxy. Thank you very much. – ktcl Aug 02 '19 at 03:36