0

I've got a local server configured with Nginx, PHP5-FPM, MySQL and some other stuff. I'm hosting two sites.

  • One static website using Twitter Bootstrap and a theme: at www.example.com
  • One WordPress blog: at blog.example.com

I know I can do the same with just a WordPress site, but the question is other. I can access the two websites from the outside (with my smartphone and my data connection, for example), but the server has (obviously) a unique IP address, and when I enter an http://192.168.1.50 (for example), it shows the first site I created, the static one.

I must disable that one in Nginx (deleting the dynamic link at /etc/nginx/sites-enabled/) and restarting the Nginx server to be able to access the second one (but only that one) from inside my LAN, and the same happens if I want to access back the first site.

Is there anyway to be able to access both sites from within my LAN?

3
  • Why don't you just access the sites by name? Mar 16, 2014 at 22:35
  • Within the network? You mean editing /etc/hosts to "deceive" my local machine?
    – javipas
    Mar 16, 2014 at 22:37
  • Yes, either by editing /etc/hosts or installing your own DNS server. Mar 16, 2014 at 23:59

1 Answer 1

1

One of the possible solutions is actually to edit your local machine's hosts file (OS X, Windows and Linux have it in different locations) file to redirect those DNS to the local IP. In my case

192.168.1.50 example.com
192.168.1.50 www.example.com
192.168.1.50 blog.example.com

After saving that changes, you can accesss that URLs in your LAN without problems. Thanks for the suggestions, Michael Hampton/Tero Kilkanen ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .