0

I need to serve myself a few static HTML documents for test purposes (playing around with Mozilla addon development, need certain content to develop against). I thought I can just install a small webserver, drop a file or two and access them over localhost.

I installed nginx from the repository (I'm on Debian). Localhost says "Welcome to nginx".

Then I added following block to nginx.conf

    server{
  listen          80 default_server;
  location / {

    index           index.html;
    root /home/rumtscho/localSite/;
  }
}

The directory /home/rumtscho/localSite exists, and there is a file called index.html there. But even after I saved the config and did /etc/init.d/nginx reload, I still see the default greeting nginx page on localhost, not my own html.

I also tried removing the location block and dropping a html directly in /etc/nginx. Again, nothing happened.

What am I doing wrong, and how do I get a page to display?

  • Did you try to clear browser cache? – masegaloeh May 16 '14 at 1:23
  • There is example configuration in sites-enabled/default. – Alexey Ten May 17 '14 at 16:04
0

It looks like you configuration is correct.You may even get rid of the default_server, being useless here.

Is your configuration correct/applied?

  1. Ensure there is no error at configuration-time
    1. Use nginx -t to validate your configuration syntax/grammar
    2. Monitor your error log while issuing service nginx reload (or kill -SIGHUP <master PID>)
  2. Ensure there is no error at run-time by monitoring your error log

Until nothing pops-up, you need to correct your configuration/setup.

Then, if the problem persists, you may ask for more help here, providing details about your setup/configuration and the steps you took.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.