Can't Access Local Site pages from Local Network

Posted January 11, 2020 6.9k views

I have a website using Nginx server located on Ubuntu i need to access this website from the other network machines, i configured the hosts file well, the Nginx server working well, the postgres sql working well, the firewall is disabled, and it works well on the local machine and site is fine with the local host, but the problem is when i’m trying to open the site on another local network machine using the hosted machine IP it just resolve the machine IP with the site name as it written on the hosts file but it doesn’t bring any of the site pages and give an error that (’s server IP address could not be found.)
Please help to to solve this issue.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I would recommend creating Nginx server blocks for each individual site and in each server, block make sure to define your domain names as the server_name.

You can follow the steps here on how to set up Nginx server blocks:

Hope that this helps!

by Justin Ellingwood
When using the Nginx web server, server blocks (similar to the virtual hosts in Apache) can be used to encapsulate configuration details and host more than one domain off of a single server. In this guide, we'll discuss how to configure server blocks in Nginx on an Ubuntu 16.04 server.
  • Hello Dear;
    I really appreciate your response to me but unfortunately everything in the link you provided i already made it before but the problem still as it’s; the site working fine on the server machine but when trying to open it on another machine on the network it covert the server IP to the site name but it give this error:-
    (This site can’t be reached’s server IP address could not be found. ERRNAMENOT_RESOLVED)
    note: it just one site on the server.

    • Hello,

      What I could suggest is trying to ping the domain name from some of the other machines on the network, for example:


      If you don’t get a response back, then try to add an entry to your hosts file on the other machines on the network as well, and then try pinging the domain again.

      Let me know how it goes!

      • Thanks a lot dear it works with editing the hosts file on the other network machine, but i’m sorry is it logic to edit the hosts file on each machine will work on the site?
        sorry for the annoyance…