S
S
soif2013-11-29 21:43:30
Nginx
soif, 2013-11-29 21:43:30

If an example of the nginx config to return just one html page?

I'm setting up nginx for the first time, reading about the nginx config and I can't figure out how to set it up so that it gives just one html page /var/www/index.html
Inside the http block at the end I write:
server {
server_name mysite.ru www.mysite. ru;
root /var/www;
index index.hrml;
}
did not touch the rest of the config.
Tell me, where is the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Galkin, 2013-11-29
@soif

Apparently there is not enough location

server {
      listen       80;
      server_name  mysite.ru www.mysite.ru;
      location / {
          root /var/www;
          index  index.html index.htm;
       }
     }

I highly recommend - nginx.org/ru/docs/beginners_guide.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question