vanting / RedSlim

RedSlim (Slim + Twig + Redbean)
http://redslim.ga/
MIT License
109 stars 17 forks source link

Trying to configure this framework in NGINX, css and js are not loading properly #8

Open leelu opened 8 years ago

leelu commented 8 years ago

Hi,

I am trying to configure this framework in NGINX with php-fpm on a Fedora-23 OS. I am not able to load css files as they prepend index.php to their routes like , http://example.com/index.php/css/bootstrap.min.css

Please request you to provide configuration details to set this framework for NGINX webserver. Here is the config which I was trying and had this issue

server {
    listen       80;
    server_name  dev.example.com lee.example.com;
    root /var/www/redslim/web;

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

    location ~ \.php {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_index index.php;
        fastcgi_pass unix:/run/php-fpm/www.sock;
    }

}
delafred commented 7 years ago

Did you tried this

if (!-e $request_filename){
    rewrite ^(.*)$ /index.php break;
}