nginx not executing basic html file -


i learning use nginx , following tutorial http://nginx.org/en/docs/beginners_guide.html. did installed nginx (at least thats when go localhost/index.html). doesnt show content of index.html file, when lookup errors in log file not logging error. don't know doing wrong here config file

user  nik; worker_processes  1;  error_log  logs/error.log; error_log  logs/error.log  notice; error_log  logs/error.log  info;  pid        /usr/local/nginx/logs/nginx.pid;   events {     worker_connections  1024; }  http {         access_log      /usr/local/nginx/logs/access.log;         error_log       /usr/local/nginx/logs/error.log;         server{                 location / {                         listen          80;                         root            /data/www;                         server_name     localhost;                         index           index.html;                         access_log      on;                  }         } } 

p.s. index.html file present inside /data/www. appreciated. thank you

i surprised if server starts. can test configuration using nginx -t or more thorough diagnostic nginx -t.

your structure wrong, listen , server_name directives should appear in server block. see this document more.

you not need write error_log 3 times same log file - in case info capture notice , more severe notifications. see this document details.

it usual start nginx daemon user set name reserved purpose, e.g. www or nginx (depending on os using) - may have reasons start own user name.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -