Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
config ngnix rewrite to fuelphp
  • I have the nginx.conf to fuelphp

    location / {

        if (!-e $request_filename) {

    rewrite ^(.*)$ index.php?/$1 last; }

        }



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

    include fastcgi.conf;
    include /etc/nginx/fastcgi_params;

    }

    but this not working with testfphp/public/welcome/hello

    the nginx says: file not found

    Where is the error


    Thank you.

  • Thank for the help but not working 

    The version is nginx/1.4.1

    I think the problem is in the rewrite rule

    if (!-e $request_filename) {<br style="box-sizing: border-box;">

    rewrite ^(.*)$ index.php?/$1 last; } 

    which should be the equivalent into .htaccess 

    for apache where it work


    or ngnix has a bug ?

  • I don't know, I've never used nginx.

    Perhaps you can pop into IRC (on freenode, channel #fuelphp), I'm pretty sure there are people present that use nginx.
  • Thanks again
  • If Someone intresting the configuration of nginx to feulphp 
    which work for me is on Archlinux

    server {
        
        
        listen 80;
        
       server_name scherzo.com www.scherzo.com;
       
       error_log /var/log/nginx/error.log;
       
       access_log  /var/log/nginx/localhost.access.log;
       
          index   index.html index.php ;
          
    autoindex off;
           
    root   /srv/http/testfphp/public;
    if (!-e $request_filename) {
            rewrite ^/(.+)$ /index.php?url=$1 last;
            break;
        }



     



    location ~ \.php$ {
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
          fastcgi_index  index.php;
          root   /srv/http/testfphp/public; #folder of fuelphp
          include        fastcgi.conf;
     }







    location ~* \favicon.ico$ {
            access_log off;
            expires 1d;
            add_header Cache-Control public;
        }
        location ~ ^/(img|cjs|ccss)/ {
            access_log off;
            expires 7d;
            add_header Cache-Control public;
        }

        # Deny access to .htaccess files,
        # git & svn repositories, etc
        location ~ /(\.ht|\.git|\.svn) {
            deny  all;
        }


    location /. {
    deny all;
    }
      
    }

    Bye


Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion