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

Blank page with Nginx

Started by Muut Archive 10 years ago · 3 replies · 2204 views
10 years ago

Hy,
I'm trying to use grav on my self hosted platform. I use Nginx, but i'm just getting a blank page instead in Safari (and a 500 http error in chrome). I've checked the permissions and also my nginx configuration taking exemple from the official one (see bellow). But still the same issue. Grav is in a 'grav' subfolder, and i have another website running on the root.

If someone have an idea of a solution I'll be very grateful.

Thanks.

TXT

server {
    listen 80;
    listen [::]:80;

    # Note: You should disable gzip for SSL traffic.
    # See: https://bugs.debian.org/773332
    #
    # Read up on ssl_ciphers to ensure a secure configuration.
    # See: https://bugs.debian.org/765782
    #
    # Self signed certs generated by the ssl-cert package
    # Don't use them in a production server!
    #
    # include snippets/snakeoil.conf; 

    root /var/www/websci;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.php;

    server_name 'servername';

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

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

        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
    }
    ## End - PHP

    ## Begin - Security
    # deny all direct access for these folders
    location ~* /(.git|cache|bin|logs|backups|tests)/.*$ { return 403; }
    # deny running scripts inside core system folders
    location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
    # deny running scripts inside user folder
    location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
    # deny access to specific files in the root folder
    location ~ /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htacce ss.txt|\.htaccess) { return 403; }
    ## End - Security
}
---
10 years ago

I think the solution is in the nginx.conf you posted, as a comment:

TXT
# for subfolders, simply adjust:
# `location /subfolder {`
# and the rewrite to use `/subfolder/index.php`
10 years ago

Thank you very much. Turns out it was some permissions issue. Should have checked twice !

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1361 9 years ago
Archive · by Muut Archive, 9 years ago
2 939 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2958 9 years ago
Archive · by Muut Archive, 9 years ago
3 1123 9 years ago