url rewrite with nginx?

98 views
Skip to first unread message

zh yang

unread,
Oct 5, 2012, 3:39:11 AM10/5/12
to limo...@googlegroups.com
Hi everyone.
It may sound stupid but I am wondering how to configure a limonade app with nginx, to enable pretty url.
Official github provides a .htaccess file for Apache. But I can't find the one for nginx.

I tried :
location / {
  try_files $uri $uir/ index.php;
}

part of index.php:

dispatch('/about/',about)
function about(){ 
  echo 'hello about!';
}

 Howerver it doesn't work. I can visit abc.com/?/about/ without issues, but I get 404 when I visit abc.com/about/ .

Thx.


Fabrice Luraine

unread,
Mar 18, 2013, 11:50:38 AM3/18/13
to limo...@googlegroups.com
You can try

    location / {
        
        try_files $uri $uri/ @rewrite;
    }
    

    location @rewrite {
        rewrite ^/(.*)$ /index.php?u=$1&$args;
    }
Reply all
Reply to author
Forward
0 new messages