0

My current rule set is:

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass localhost:8000;
    }

I need to pass all the request to index.php;

Exceptions : robots.txt file and everything inside images/ directory and sub directory.

1 Answer 1

1

Set the locations in the order:

location ~* /robots\.txt$ {
    try_files $uri =404;
}

location ~* /images {
    try_files $uri =404;
}

location / {
    try_files /index.php$is_args$args =404;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass localhost:8000;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.