Reputation: 61
I have a domain name: www.domain.com. I setup a DNS type A record with my router's public IP address.
Now if I go to www.domain.com, I'd be redirected to my router's homepage. What I need to do is to forward the port to my node.js server application that is running at localhost:3000.
Picture for reference. https://i.sstatic.net/UL682.png
The IP address should be my computer's IP I got from entering ifconfig
into the terminal. So I enter my computer's IP address and 3000 for the port.
Now if I go to my www.domain.com, I still get the my router's homepage.
Does anyone have an idea what port I should be entering?
Upvotes: 5
Views: 16870
Reputation: 101
Trouble Shoot TESTS: Two things come to mind. Your IP address(external vs internal) and Port Forwarding. Thing to remember: 1.You can only port forward to one device. 2.When you Port Forward you will need to use your Local(internal) IP address of the device you want to Port Forward to.
Tests:
1.Try from a different computer (that is in your local network) to access your site. If you can see it, your routers home page is set to the same port. You will need to change that. Look it up in support from the company who made the router web page.
2.Try to access from out side you network. (cellphone with wifi off) If you see your routers home page your router has been set to enable remote access to the router. You will need to turn that off.
3.In CMD window(Windows 10 type cmd in Cortana search box on the bottom left and hit enter) type "ipconfig" hit enter. Default IP is your router and "IPv4 Address" is the IP of device you are on right now. when you Port Forward us your IPv4 Address.
Upvotes: 0
Reputation: 1236
Do you actually want to run the production site www.[yourdomain].com
on your local machine? Or is that just an example and are you only interested in having a development/test environment available publicly?
If the second, then you could also try a completely different solution: use port forwarding software like ngrok. You can install and run the ngrok
client on your local machine and it will set up a tunnel for you, to make your local machine visible on the internet.
You will receive a URL like http://6cdd8912.ngrok.io
which tunnels to your local machine.
Every time you start ngrok
, a new tunnel with a new hostname is created, so this is not a good solution for production websites.
Upvotes: 8
Reputation: 11772
In router, you configure Router's homepage port to other port (ex. 8080).
In port forwarding : configure :
Local Port and IP : Port start: 80, Port end: 80.
Remote Port and IP : Chose : IP adrress : Local Ip's address of node.js Server
Port Start: 3000 Port End : 3000
Upvotes: 1