Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
TIME_WDAY, переменные окруж ения
- To: nginx-ru@xxxxxxxxx
- Subject: TIME_WDAY, переменные окруж ения
- From: Stas Scherbakov <stas@xxxxxx>
- Date: Wed, 23 Jan 2008 17:09:18 +0300
- Organization: NOX Comp.
Здравствуйте, Доны.
Есть ли в nginx возможность определить переменную окружения в
зависимости от куки юзера и от дня недели? Так, чтобы потом эту
переменную подставлять в html с помощью SSI? В апаче у меня это
работает так:
# Passing color cookie to environment variable
RewriteCond %{HTTP_COOKIE} color=([0-6])
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:%1,env=HTTP_COLOR_NUM:%1,skip=7]
# If color is not set with the cookie, assign color depending on current weekday
RewriteCond %{TIME_WDAY} 0
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:4,env=HTTP_COLOR_NUM:4,skip=6]
RewriteCond %{TIME_WDAY} 1
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:0,env=HTTP_COLOR_NUM:0,skip=5]
RewriteCond %{TIME_WDAY} 2
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:6,env=HTTP_COLOR_NUM:6,skip=4]
RewriteCond %{TIME_WDAY} 3
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:3,env=HTTP_COLOR_NUM:3,skip=3]
RewriteCond %{TIME_WDAY} 4
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:2,env=HTTP_COLOR_NUM:2,skip=2]
RewriteCond %{TIME_WDAY} 5
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:5,env=HTTP_COLOR_NUM:5,skip=1]
RewriteCond %{TIME_WDAY} 6
RewriteRule \.(shtml|cgi|fcgi) - [env=color_num:1,env=HTTP_COLOR_NUM:1]
Успехов.
--
Щербаков Станислав
(095) 785-9574
www.nox.ru, www.kleo.ru mailto:stas@xxxxxx
|