LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2012, 12:08 PM   #1
kb2tfa
Member
 
Registered: Oct 2006
Location: New Jersey
Distribution: CentOS
Posts: 175

Rep: Reputation: 18
Question Nginx on a local machine


I have an Ubuntu 12.10 with Nginx. The ip is 10.0.0.6 to access from other computers on my network.

The default page displays telling me the server is working, but when I create a virtual domain it displays same default page.

here is my file site1.com
Code:
server {

listen   80;
server_name site1.com;

access_log /var/www/site1.com/logs/access.log;
error_log /var/www/site1.com/logs/error.log;

location / {

root   /var/www/site1.com/;
index  index.html;

}

}
Using this method on a live dedicated machine of mine works fine, but not on my local machine.

I'm thinking it's something to do with the access of useing the ip maybe?

for example I have to access the local as http://10.0.0.6/site1.com

do you think this has something to do with it?

EDIT: I do have the ln -s link for sites-enabled and I have restarted nginx

Last edited by kb2tfa; 11-20-2012 at 12:17 PM.
 
Old 11-20-2012, 04:16 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

If you want to access you nginx server from other computers using the hostname site1.com, you'll need a dns server (or add an entry in other boxes hosts file)
If you use just the IP to access your server, you need to add it in the server_name directive, like this:
Code:
server_name site1.com 10.0.0.6;
Regards

Last edited by bathory; 11-20-2012 at 04:29 PM.
 
1 members found this post helpful.
  


Reply

Tags
nginx



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unable to connect to nginx server from other machine dhairya Linux - Newbie 7 07-31-2011 11:50 PM
mounting samba filesystem on remote machine as /home on local machine shishirkotkar Linux - Software 1 04-28-2008 05:05 AM
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 12:23 PM
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
Complicated one: MySQL, rsync, remote machine, local machine daiver Linux - General 2 02-27-2006 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration