if set variable unfamiliar language
Edho P Arief
edhoprima at gmail.com
Thu Dec 17 19:45:29 MSK 2009
On Thu, Dec 17, 2009 at 5:48 PM, nerdgrind <nginx-forum at nginx.us> wrote:
> I see http://wiki.nginx.org/NginxHttpRewriteModule now, but I am still unsure about how some of the logic works. For example the follow rewrite code block allows YOURLS to be properly used with Nginx, but I don't see how this flows logically.:
>
>
> if (!-f $request_filename){
> set $rule_0 1$rule_0;
> }
> if (!-d $request_filename){
> set $rule_0 2$rule_0;
> }
> if ($rule_0 = "21"){
> rewrite ^/([0-9a-z]+)/?$ /yourls-go.php?id=$1 last;
> }
>
also read try_files for such task
location ~ ^/([\da-z]+)/?$
{
try_files $uri $uri/ /yourls-go.php?id=$1;
}
--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the nginx
mailing list