Linux: iptables port forward to use with Vagrant.
If you are using Vagrant to host your local dev environment you might want to access your apps the way: http://yourdomain.local.
First, add this line to the host /etc/hosts file:
127.0.0.1 yourdomain.local
Save the changes and then type:
$ sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
And the trick is done.
A better alternative is to use a rack application proxy like Prax: https://github.com/ysbaddaden/prax
Written by Gerardo SE
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Apache
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#