Reputation: 61
I installed VM on Azure and I am trying to map public port 80 to private port 8080. I can find a lot of answers how to do do it using the old interface (using Endpoints) but I cannot find anything how to do it with the new portal (inbound and outbound security rules, Endpoins are gone). I created the inbound rules and I can access the app on port 8080 when I expose it, but I cannot figure out how to implement the translation from port 80 into private 8080.
Upvotes: 2
Views: 7268
Reputation: 1279
You need to have a NIC associated with your VM. The NIC has a public IP address associated with it, and the NIC is in a network security group (NSG) that defines all the rules. Once you have attached the NSG to the NIC, you can go into the NSGs settings and modify the inbound and outbound security rules.
This answer shows a bit better what you are after..
Also here is a picture of what you are trying to do. It is possible...
Upvotes: 2
Reputation: 61
As it seems that with ARM it is no more possible to configure the port mapping, to avoid need of adding another server working as a load balancer, I created a rule in iptables (I am running Ubuntu server):
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
Not ideal but it works.
Upvotes: 2