Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Aug 03, 2013 12:43 am 
Offline
Senior Newbie

Joined: Sun Jul 21, 2013 12:53 am
Posts: 5
Hello I'm running Linode debian 7.0 with nginx 1.2 installed( from debian package repo).

I want to use nginx for my rack app, but i want to learn to server static files first.
When I want to start nginx, I got this error:
Code:
Starting nginx: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/footdotcom:10
nginx: configuration file /etc/nginx/nginx.conf test failed


Here the snippet for my config file in nginx's sites-available/

Code:
server {
   listen 80;
   server_name www.foo.com;
   rewrite ^/(.*) http://foo.com/$1 permanent;

}

server {
   listen 80;
   server foo.com;
   access_log /home/mhd/website/foodotcom/access.log;
   error_log /home/mhd/website/foodotcom/error.log;
   location / {
      root  /home/mhd/website/foodotcom/public/;
      index index.html;
   }


}



I followed the config more or less from:
http://socrateos.blogspot.com/2011/08/r ... -with.html

Any help would be very appreciated


Top
   
PostPosted: Sat Aug 03, 2013 8:56 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
The "/etc/nginx/sites-enabled/footdotcom:10" means that the problem is on line 10 of /etc/nginx/sites-enabled/footdotcom. It's probably the line that says "server" instead of "server_name".

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
PostPosted: Mon Aug 05, 2013 10:00 pm 
Offline
Senior Newbie

Joined: Sun Jul 21, 2013 12:53 am
Posts: 5
Wow you are right..How could I miss that?? Must be fatigue >_< .Tnx


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group