Nginx 404

I have nginx setup in front of my grav installation. Also installed php-fpm. php-fpm is running, nginx is running with the provided config file in the base repo and I’m getting a 403 Forbidden when I navigate to my root page and then a 404 saying Woops. Looks like this page doesn't exist. when I navigate to /index.php. Any ideas on whats happening? Here’s my nginx file

server {
    listen 80;
    index index.html index.php;
    server_name localhost;
    root /opt/grav;

    # for subfolders, simply adjust the rewrite:
    # to use `/subfolder/index.php`
    location / {
        try_files $uri $uri/ /index.html;
        if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; }
    }

    location ~ \.php$ {
        # Choose either a socket or TCP/IP address
        fastcgi_pass unix:/var/run/php5-fpm/grav.sock;
        # fastcgi_pass 127.0.0.1:9000;

Sorry for the multiple posts I made, tried to fix formatting and there’s no edit button. Just an undo. But it should be good now.

It’s definitely related to your rewrite setup and the nginx configuration.

Are you accessing your site via http://localhost ?

Hey @rhukster, thanks for checking in. Turns out with enough time and hours on google I figured it out. I am somewhat new to php, so coming from a sysadmin background I was banging my head against a wall. But the fix was chmod +x /opt and chmod +x /opt/grav. It may have also been a chmod 755 /opt/grav as well but I am not sure if I had already set that or not. I thought I did.

Glad you got it sorted!