Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just installed nginx on debian, and do basic configuration(add server part) in nginx.conf file

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    # multi_accept on;
}

http {
    include       /etc/nginx/mime.types;
    default_type application/octet-stream;
    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
#    tcp_nodelay        on;

#    gzip  on;
#    gzip_disable "MSIE [1-6]\.(?!.*SV1)";

#    include /etc/nginx/conf.d/*.conf;
#    include /etc/nginx/sites-enabled/*;

    server {
        listen 80;
        server_name localhost;
        location / {
                root html;
                index index.html index.htm;
        }
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root html;
        }
    }
}

# mail {
#     # See sample authentication script at:
#     # http://wiki.nginx.org/NginxImapAuthenticateWithApachePhpScript
#
#     # auth_http localhost/auth.php;
#     # pop3_capabilities "TOP" "USER";
#     # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#     server {
#         listen     localhost:110;
#         protocol   pop3;
#         proxy      on;
#     }
#
#     server {
#         listen     localhost:143;
#         protocol   imap;
#         proxy      on;
#     }
# }

I allways get "404 Not Found" error message insted of index.html page.

Nginx installation folder is

/etc/nginx 

Configuration file is in

/etc/nginx/nginx.conf 

and index.html and 50x.html in

/etc/nginx/html 

folder.

What am i doing wrong? Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I don't see document_root nor root set to paths where index.html is located; set those to respective path where index.html is and all should work.

share|improve this answer
    
Thanks, i always forget something. –  salafek Feb 26 '12 at 18:53

Your Answer

 
discard

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.