Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
  • One WordPress blog: at

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 (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?

share|improve this question
Why don't you just access the sites by name? – Michael Hampton Mar 16 '14 at 22:35
Within the network? You mean editing /etc/hosts to "deceive" my local machine? – javipas Mar 16 '14 at 22:37
Yes, either by editing /etc/hosts or installing your own DNS server. – Tero Kilkanen Mar 16 '14 at 23:59

1 Answer 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

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.