0

i'm setting up an webserver based on nginx and php-fpm. All is ok but my domain opens just directory on www.domain.com/ - it should open index.php as i got this in my config:

location / {
    autoindex  on;
    try_files $uri $uri/ /index.php;
}

It should open index.php when typing www.domain.com - but it dont. How i can set root file - index.php index.html index.htm?

Sander Steffann
  • 7,712
  • 19
  • 29

1 Answers1

0

Your server block needs to contain the index directive.

server {
    index index.php;
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972