DEV Community

Discussion on: Explain me Ngnix

Collapse
 
jhilgeman profile image
Jonathan H • Edited

Not usually. There is almost always some setup and several things to consider.

  1. Your public IP usually changes unless you have paid extra to your ISP to have a static one. So you usually have to have a way to work around that (e.g. dynamic DNS).

  2. If you're on a home internet connection, your ISP might block you from doing this. A lot of ISPs don't want their customers to be serving up lots of traffic.

  3. Most people are still behind a firewall using NAT. What that means is that your public IP isn't the same as your local network IP. Basically, IPv4 (IP addresses with 4 numbers and a dot between them like 1.2.3.4) only had a couple billion IP addresses (from 0.0.0.0 to 255.255.255.255). Since there many, many more internet-connected devices than public IP addresses, a technology called NAT made it possible to create a private network with its own private IP addresses. So your public IP might be 1.2.3.4 but your computer's IP address might be 192.168.1.10. The traffic that goes to 1.2.3.4 goes to your router or firewall device, and then it has to be routed to your machine. So you usually have to configure your firewall/router to route traffic on ports 80 (the normal port for HTTP) and 443 (HTTPS) to your computer.

Then you have to consider that if your computer is down or updating or rebooting or the web server isn't running, then nobody can access your site.

You also have to consider that if you have any vulnerabilities in your website or you don't keep the web server updated or if it's not configured correctly, you could be vulnerable to hackers who might be able to access other files on your hard drive or even erase things.

So there's quite a few things to consider. It is why people who are getting started with websites usually pay for basic hosting services. Those other companies have everything already configured and they take care of almost all of those problems for you.

So while you -can- host from your local computer, it's usually a bad idea and almost always takes setup.

Thread Thread
 
rishitkhandelwal profile image
Rishit Khandelwal

Thanks!