Skip to content

Instantly share code, notes, and snippets.

@ajithrn
Forked from avtaniket/localhost to custom domain in ubuntu.txt
Last active June 20, 2017 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajithrn/25c2b5cbae71452022dbaf2d99356f1b to your computer and use it in GitHub Desktop.
Save ajithrn/25c2b5cbae71452022dbaf2d99356f1b to your computer and use it in GitHub Desktop.
Ubuntu / localhost to custom domain
Step 1: Add domain entry in hosts file (sudo nano /etc/hosts)
127.0.0.1 local-server.dev
Step 2: Add redirection policy in IP-Tables
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment