Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am quite new to Nginx and I have just found the following directive in a Nginx configuration file:

if (!-f $request_filename){
            set $rule_1 1$rule_1;
}

While I can understand what the condition is, for the life of me I can't understand what that set directive sets $rule_1 to and what those two variables stand for ($rule_1 and 1$rule_1). I have tried reading the Nginx documentation but I'm still as clueless as before.

Any pointer or reading material is welcome.

Thanks a lot.

share|improve this question

2 Answers 2

It prepends "1" to $rule_1 variable. Seems, $rule_1 variable is checked somewhere else.

share|improve this answer
    
Thanks, you're right. By looking at the rest of the code I was finally able to make sense of this. It basically checks whether the requested file is actually a file, if not, it sets $rule_1 to 1, since $rule_1 is undefined. –  finferflu Jan 24 '11 at 20:53

By looking at the rest of the code I was finally able to make sense of this. It basically checks whether the requested file is actually a file, if not, it sets $rule_1 to 1, since $rule_1 is undefined.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.