Grav on Nginx Help!

Hi I installed Grav on a Nginx web server and when going to domain/grav I get a blank white page. I then looked over the conf file for nginx and added this to the domains conf this now gives me an file not found error even tho grav folder is their.

Any ideas?

Not much is absolutely required to get Grav running under Nginx. I have it running on my RaspberryPi with very little configuration:

server {
        root /home/pi/www/blog;
        index index.html index.php;
        server_name localhost;

        location / {
                try_files $uri $uri/ /index.html;
                if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; }
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}

That’s it. No extra security or anything but just enough to get it running and routing properly.

Hi thanks for the reply. My setup is similar. I have managed to fix the blank white page issue after checking error logs in php as it relates to permissions error. :slight_smile:

Now I have a new issue… My domain.com shows directory forbidden. If I do domain.com/grav I get the page up but it says 404 to the content clicking on the menu bar the next stock page loads up fine but the link is domain.com/about I thought it would be domain.com/grav/about so seems my conf is still wrong??

Not sure how to login to grav to edit files either.

So i used your config as above and changed stuff. I can now see the site at domain.com but still get a 404 error. After looking at the learning section the first thing I should see the wo hoo installed grav message but i dont see this.

Link to site http://s-heer.co.uk/ Clicking Home CSS dont seem to load properly on the url /home but clicking any of the other nav items seems to load the content fine. Not sure where I have gone wrong.

It actually looks like your entire site is functioning correctly. All the links work except the homepage. Although clicking Home in the menu does work. This makes me think you have the home: alias: option in the system.yaml set to an invalid page. It probably should be set to /home

Hi

Ah yeah so for the original CSS missing and content not appearing. I found the home page and it seems I had a default file in here as well as the template content (I first uploaded grav on its own before seeing the template includes all grav files so i uploaded that too). So I deleted default file and then that started working (no longer got blank css page on /home). I did indeed edit system.yaml because i didnt want the page /home but wanted it at the top level so i changed it to simply / i have reverted it back to /home and its now working again.

Thanks for your help

Cool!