Port forwarding with NAT and iptables (transparent proxying) - “Run” your webapp on port 80

Hussein Nasser
Hussein Nasser
23.3 هزار بار بازدید - 5 سال پیش - 💻 More software engineering videos    
💻 More software engineering videos    • Software Engineering by Example   We have written countless web apps on this channel, but most of them pretty much always run port 8080 or 3000 or some ugly ports. In this video we will learn how to make our app run on port 80 or at least seem to be running on port 80. Running your web app whether nodejs or python on port 80 require root access which is always a bad idea. So better way is to use a reverse proxy like nginx or do DNAT like what we will do in this video. *** Forward packet from one port to another sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.254.47:8080 *** To clean the NAT table sudo iptables -t nat -F *** To Masquerade in case you want to forward to another ip address sudo iptables -t nat -A POSTROUTING -p tcp --dport 80 -j MASQUERADE https://www.seevid.ir/fa/w/uuWzk8U4dJE Intro https://www.seevid.ir/fa/w/uuWzk8U4dJE Port forward routing https://www.seevid.ir/fa/w/uuWzk8U4dJE nginx https://www.seevid.ir/fa/w/uuWzk8U4dJE NAT Stay Awesome! Hussein
5 سال پیش در تاریخ 1398/04/15 منتشر شده است.
23,367 بـار بازدید شده
... بیشتر