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'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?

share|improve this question

1 Answer 1

Your server block needs to contain the index directive.

server {
    index index.php;
share|improve this answer

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.