Best way to get $request_filename
Marcus Clyne
maccaday at gmail.com
Thu Jul 16 02:28:13 MSD 2009
Maxim Dounin wrote:
> Hello!
>
> On Wed, Jul 15, 2009 at 10:13:26PM +0300, Marcus Clyne wrote:
>
>
>> Hi,
>>
>> What's the best way to get the variable $request_filename from a custom
>> module?
>>
>> Currently I save the index of the $request_filename variable and call
>> ngx_http_get_indexed_variable (r, request_filename_var_index), but is
>> there a better way?
>>
>
> If you need variable - using indexed one is the best choise.
>
> For request filename you may want to consider using
> ngx_http_map_uri_to_path() directly though. See static module (or
> gzip static, or flv, or request_filename variable get handler code)
> for examples.
>
> Maxim Dounin
>
Thanks.
More information about the nginx
mailing list