nginxÄÜ·ñ¿´ä¯ÀÀÆ÷°æ±¾
ÊÇ£¬nginx¿ÉÒÔʹÓà $http_user_agent ±äÁ¿»ò ngx_http_useragent_module Ä£¿éÉó²éä¯ÀÀÆ÷°æ±¾£¬´Ó¶ø»ñÈ¡ÓйØÇëÇó¿Í»§¶ËµÄÐÅÏ¢£¬°üÀ¨ä¯ÀÀÆ÷°æ±¾¡£
nginxÄÜ·ñÉó²éä¯ÀÀÆ÷°æ±¾£¿
ÊÇ£¬nginx¿ÉÒÔÉó²éä¯ÀÀÆ÷°æ±¾¡£
nginxÊÇÒ»¿îÆÕ±éʹÓõĿªÔ´webЧÀÍÆ÷£¬ËüÌṩÁËÉó²éÇëÇóµÄä¯ÀÀÆ÷°æ±¾ÐÅÏ¢µÄÄÜÁ¦¡£Õâ¿ÉÒÔͨ¹ýʹÓÃÒÔÏÂÒªÁìʵÏÖ£º
ʹÓÃ$http_user_agent±äÁ¿
nginxÖеÄ$http_user_agent±äÁ¿°üÀ¨ÓйØÇëÇóµÄ¿Í»§¶ËµÄÐÅÏ¢£¬°üÀ¨ä¯ÀÀÆ÷°æ±¾¡£Òª»ñÈ¡ä¯ÀÀÆ÷°æ±¾£¬¿ÉÒÔʹÓÃÒÔÏÂÉèÖÃÖ¸Á
set $browser_version $http_user_agent;
µÇ¼ºó¸´ÖÆ
ʹÓÃngx_http_useragent_moduleÄ£¿é
ngx_http_useragent_moduleÊÇnginxµÄÒ»¸öÄ£¿é£¬ËüÌṩÁ˸ü¸ß¼¶µÄ¹¦Ð§À´ÆÊÎöºÍ´¦ÀíÓû§ÊðÀí×Ö·û´®¡£ÒªÊ¹ÓôËÄ£¿é£¬Ê×ÏÈÐèÒªÔÚnginxÉèÖÃÖмÓÔØËü£º
load_module modules/ngx_http_useragent_module.so;
µÇ¼ºó¸´ÖÆ
È»ºó£¬¿ÉÒÔʹÓÃÒÔÏÂÉèÖÃÖ¸Áî»ñÈ¡ä¯ÀÀÆ÷°æ±¾£º
user_agent_variable browser_version;
µÇ¼ºó¸´ÖÆ
ͨ¹ýʹÓÃÕâЩҪÁ죬nginx¿ÉÒÔÇáËɵØÉó²éÇëÇóµÄä¯ÀÀÆ÷°æ±¾¡£Õâ¹ØÓÚʶ±ðä¯ÀÀÆ÷Ìض¨¹¦Ð§¡¢ÊµÑéÄÚÈÝÐÉÌ»ò¾ÙÐÐÍøÕ¾ÆÊÎöºÜÊÇÓÐÓá£
ÒÔÉϾÍÊÇnginxÄÜ·ñ¿´ä¯ÀÀÆ÷°æ±¾µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡