Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Grav on Nginx Help!

Started by Muut Archive 11 years ago · 7 replies · 435 views
11 years ago

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?

11 years ago

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

TXT
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.

11 years ago

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. :)

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.

11 years ago

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.

11 years ago

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

11 years ago

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.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1323 9 years ago
Archive · by Muut Archive, 9 years ago
2 920 9 years ago
Archive · by Muut Archive, 9 years ago
2 4048 9 years ago
Archive · by Muut Archive, 9 years ago
1 2924 9 years ago
Archive · by Muut Archive, 9 years ago
3 1106 9 years ago