What does this nginx error mean when restarting the server?
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:
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/
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:
Any help would be very appreciated