Load local website from the same LAN by accessing the local IP (192.168.X.X)

17 Views Asked by At

I have a domain.com that is working just fine on the web, and the Nginx is set to deliver it using SSL (443). What I'm trying to do is to access the same site, from the same LAN, using its LAN IP (example 192.168.1.2, where 192.168.1.2 is the Nginx server that hosts the domain.com)

The issue is that that when I load 192.168.1.2 in the browser, a 403 error page displays, not the website files. At the very end of the domain.com nginx config file, I have added the following code:

server {
    listen 80;
    server_name "" 192.168.1.2;
root /var/www/domain.com/html;
}

From my knowledge, this should work. What is wrong with it?

0

There are 0 best solutions below