{"id":374,"date":"2013-07-29T12:01:01","date_gmt":"2013-07-29T04:01:01","guid":{"rendered":"http:\/\/www.shuran.cn\/?p=374"},"modified":"2013-07-29T12:01:01","modified_gmt":"2013-07-29T04:01:01","slug":"openrestynginx%e6%89%a9%e5%b1%95%e5%ae%9e%e7%8e%b0%e9%98%b2cc%e6%94%bb%e5%87%bb","status":"publish","type":"post","link":"https:\/\/www.shuran.cn\/?p=374","title":{"rendered":"OpenResty(nginx\u6269\u5c55)\u5b9e\u73b0\u9632cc\u653b\u51fb"},"content":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u4f7f\u7528<a title=\"openresty\" href=\"http:\/\/www.centos.bz\/tag\/openresty\/\">openresty<\/a>\u6765\u5b9e\u73b0\u9632cc\u653b\u51fb\u7684\u529f\u80fd\u3002openresty\u5b98\u7f51<a href=\"http:\/\/openresty.org\/cn\/index.html\" target=\"_blank\">http:\/\/openresty.org\/cn\/index.html<\/a>\u3002\u4e0b\u9762\u662f\u9632cc\u653b\u51fb\u7684\u6d41\u7a0b\u56fe\u3002<br \/>\n\u6839\u636e\u6d41\u7a0b\u56fe\uff0c\u6211\u4eec\u77e5\u9053\u9632cc\u653b\u51fb\u4e3b\u8981\u5305\u62ec\u4e24\u90e8\u5206\uff0c\u4e00\u662f\u9650\u5236\u8bf7\u6c42\u901f\u5ea6\uff0c\u4e8c\u662f\u7ed9\u7528\u6237\u53d1\u9001js\u8df3\u8f6c\u4ee3\u7801\u8fdb\u884c\u9a8c\u8bc1\u8bf7\u6c42\u662f\u5426\u5408\u6cd5\u3002<br \/>\n<a href=\"http:\/\/www.centos.bz\/wp-content\/uploads\/2012\/12\/cc.png\" rel=\"1&amp;nbsp;of&amp;nbsp;1\" rev=\"0\"><img loading=\"lazy\" decoding=\"async\" alt=\"cc\" src=\"http:\/\/www.centos.bz\/wp-content\/uploads\/2012\/12\/cc.png\" width=\"623\" height=\"653\" \/><\/a><\/p>\n<h3 id=\"\u4e00\u3001\u5b89\u88c5\u4f9d\u8d56\">\u4e00\u3001\u5b89\u88c5\u4f9d\u8d56<\/h3>\n<p><a title=\"centos\" href=\"http:\/\/www.centos.bz\/\">centos<\/a>:<\/p>\n<div>\n<div id=\"highlighter_610328\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<\/td>\n<td>\n<div>\n<div><code>yum <\/code><code>install<\/code> <code>readline-devel pcre-devel openssl-devel<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><a title=\"ubuntu\" href=\"http:\/\/www.centos.bz\/category\/other-system\/ubuntu\/\">ubuntu<\/a>:<\/p>\n<div>\n<div id=\"highlighter_931977\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<\/td>\n<td>\n<div>\n<div><code>apt-get <\/code><code>install<\/code> <code>libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3 id=\"\u4e8c\u3001luajit\u5b89\u88c5\">\u4e8c\u3001luajit\u5b89\u88c5<\/h3>\n<div>\n<div id=\"highlighter_308151\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<div>2<\/div>\n<div>3<\/div>\n<div>4<\/div>\n<div>5<\/div>\n<div>6<\/div>\n<\/td>\n<td>\n<div>\n<div><code>cd<\/code> <code>\/tmp\/<\/code><\/div>\n<div><code>git clone http:<\/code><code>\/\/luajit<\/code><code>.org<\/code><code>\/git\/luajit-2<\/code><code>.0.git<\/code><\/div>\n<div><code>cd<\/code> <code>luajit-2.0\/<\/code><\/div>\n<div><code>make<\/code> <code>&amp;&amp; <\/code><code>make<\/code> <code>install<\/code><\/div>\n<div><code>ln<\/code> <code>-sf luajit-2.0.0-beta10 <\/code><code>\/usr\/local\/bin\/luajit<\/code><\/div>\n<div><code>ln<\/code> <code>-sf <\/code><code>\/usr\/local\/lib\/libluajit-5<\/code><code>.1.so.2 <\/code><code>\/usr\/lib\/<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3 id=\"\u4e09\u3001openresty\u5b89\u88c5\">\u4e09\u3001openresty\u5b89\u88c5<\/h3>\n<div>\n<div id=\"highlighter_439315\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<div>2<\/div>\n<div>3<\/div>\n<div>4<\/div>\n<div>5<\/div>\n<div>6<\/div>\n<\/td>\n<td>\n<div>\n<div><code>cd<\/code> <code>\/tmp<\/code><\/div>\n<div><code>wget http:<\/code><code>\/\/agentzh<\/code><code>.org<\/code><code>\/misc\/nginx\/ngx_openresty-1<\/code><code>.2.4.13.<\/code><code>tar<\/code><code>.gz<\/code><\/div>\n<div><code>tar<\/code> <code>xzf ngx_openresty-1.2.4.13.<\/code><code>tar<\/code><code>.gz <\/code><\/div>\n<div><code>cd<\/code> <code>ngx_openresty-1.2.4.13\/<\/code><\/div>\n<div><code>.<\/code><code>\/configure<\/code> <code>--prefix=<\/code><code>\/usr\/local\/openresty<\/code> <code>--with-luajit<\/code><\/div>\n<div><code>make<\/code> <code>&amp;&amp; <\/code><code>make<\/code> <code>install<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3 id=\"\u56db\u3001nginx\u914d\u7f6e\">\u56db\u3001nginx\u914d\u7f6e<\/h3>\n<p><a title=\"nginx\" href=\"http:\/\/www.centos.bz\/category\/web-server\/nginx\/\">nginx<\/a>.conf:<\/p>\n<div>\n<div id=\"highlighter_244350\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<div>2<\/div>\n<div>3<\/div>\n<div>4<\/div>\n<div>5<\/div>\n<div>6<\/div>\n<div>7<\/div>\n<div>8<\/div>\n<div>9<\/div>\n<div>10<\/div>\n<div>11<\/div>\n<div>12<\/div>\n<div>13<\/div>\n<div>14<\/div>\n<div>15<\/div>\n<div>16<\/div>\n<div>17<\/div>\n<div>18<\/div>\n<div>19<\/div>\n<div>20<\/div>\n<div>21<\/div>\n<\/td>\n<td>\n<div>\n<div><code>http{<\/code><\/div>\n<div><code>[......]<\/code><\/div>\n<div><code>lua_shared_dict limit 10m;<\/code><\/div>\n<div><code>lua_shared_dict jsjump 10m;<\/code><\/div>\n<div><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>server {<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>#lua_code_cache off;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>listen\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 80;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>server_name\u00a0 www.centos.bz;<\/code><\/div>\n<div><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>location \/ {<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>default_type\u00a0 text<\/code><code>\/html<\/code><code>;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>content_by_lua_file <\/code><code>\"\/usr\/local\/openresty\/nginx\/conf\/lua\"<\/code><code>;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>}<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>location @cc {<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>internal;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>root\u00a0\u00a0 html;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>index\u00a0 index.html index.htm;<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>}<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>}<\/code><\/div>\n<div><code>}<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\/usr\/local\/openresty\/<a title=\"nginx\" href=\"http:\/\/www.centos.bz\/tag\/nginx-2\/\">nginx<\/a>\/conf\/lua\u6587\u4ef6:<\/p>\n<div>\n<div id=\"highlighter_789426\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<div>2<\/div>\n<div>3<\/div>\n<div>4<\/div>\n<div>5<\/div>\n<div>6<\/div>\n<div>7<\/div>\n<div>8<\/div>\n<div>9<\/div>\n<div>10<\/div>\n<div>11<\/div>\n<div>12<\/div>\n<div>13<\/div>\n<div>14<\/div>\n<div>15<\/div>\n<div>16<\/div>\n<div>17<\/div>\n<div>18<\/div>\n<div>19<\/div>\n<div>20<\/div>\n<div>21<\/div>\n<div>22<\/div>\n<div>23<\/div>\n<div>24<\/div>\n<div>25<\/div>\n<div>26<\/div>\n<div>27<\/div>\n<div>28<\/div>\n<div>29<\/div>\n<div>30<\/div>\n<div>31<\/div>\n<div>32<\/div>\n<div>33<\/div>\n<div>34<\/div>\n<div>35<\/div>\n<div>36<\/div>\n<div>37<\/div>\n<div>38<\/div>\n<div>39<\/div>\n<div>40<\/div>\n<div>41<\/div>\n<div>42<\/div>\n<div>43<\/div>\n<div>44<\/div>\n<div>45<\/div>\n<div>46<\/div>\n<div>47<\/div>\n<div>48<\/div>\n<div>49<\/div>\n<div>50<\/div>\n<div>51<\/div>\n<div>52<\/div>\n<div>53<\/div>\n<div>54<\/div>\n<\/td>\n<td>\n<div>\n<div><code>local<\/code> <code>ip = ngx.var.binary_remote_addr<\/code><\/div>\n<div><code>local<\/code> <code>limit = ngx.shared.limit<\/code><\/div>\n<div><code>local<\/code> <code>req,_=limit:get(ip)<\/code><\/div>\n<div><code>if<\/code> <code>req <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>if<\/code> <code>req &gt; 20 <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>ngx.<\/code><code>exit<\/code><code>(503)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>limit:incr(ip,1)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>end<\/code><\/div>\n<div><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>limit:<\/code><code>set<\/code><code>(ip,1,10)<\/code><\/div>\n<div><code>end<\/code><\/div>\n<div><\/div>\n<div><code>local<\/code> <code>jsjump = ngx.shared.jsjump<\/code><\/div>\n<div><code>local<\/code> <code>uri = ngx.var.request_uri<\/code><\/div>\n<div><code>local<\/code> <code>jspara,flags=jsjump:get(ip)<\/code><\/div>\n<div><code>local<\/code> <code>args = ngx.req.get_uri_args()<\/code><\/div>\n<div><code>if<\/code> <code>jspara <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>if<\/code> <code>flags <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>ngx.<\/code><code>exec<\/code><code>(<\/code><code>\"@cc\"<\/code><code>)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>local<\/code> <code>p_jskey=<\/code><code>''<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>if<\/code> <code>args[<\/code><code>\"jskey\"<\/code><code>] and <\/code><code>type<\/code><code>(args[<\/code><code>\"jskey\"<\/code><code>])==<\/code><code>'table'<\/code> <code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>p_jskey=args[<\/code><code>\"jskey\"<\/code><code>][table.getn(args[<\/code><code>\"jskey\"<\/code><code>])]<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>p_jskey=args[<\/code><code>\"jskey\"<\/code><code>]<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>end<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>if<\/code> <code>p_jskey and p_jskey==tostring(jspara) <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>jsjump:<\/code><code>set<\/code><code>(ip,jspara,3600,1)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>ngx.<\/code><code>exec<\/code><code>(<\/code><code>\"@cc\"<\/code><code>)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>local<\/code> <code>url=<\/code><code>''<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>if<\/code> <code>ngx.var.args <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>url=ngx.var.scheme..<\/code><code>\":\/\/\"<\/code><code>..ngx.var.host..uri..<\/code><code>\"&amp;jskey=\"<\/code><code>..jspara<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>url=ngx.var.scheme..<\/code><code>\":\/\/\"<\/code><code>..ngx.var.host..uri..<\/code><code>\"?jskey=\"<\/code><code>..jspara<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>end<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>local<\/code> <code>jscode=<\/code><code>\"&lt;script&gt;window.location.href='\"<\/code><code>..url..<\/code><code>\"';&lt;\/script&gt;\"<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>ngx.say(jscode)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>end<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>end<\/code><\/div>\n<div><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>math.randomseed( os.<\/code><code>time<\/code><code>() );<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>local<\/code> <code>random=math.random(100000,999999)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>jsjump:<\/code><code>set<\/code><code>(ip,random,60)<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>local<\/code> <code>url=<\/code><code>''<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>if<\/code> <code>ngx.var.args <\/code><code>then<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>url=ngx.var.scheme..<\/code><code>\":\/\/\"<\/code><code>..ngx.var.host..uri..<\/code><code>\"&amp;jskey=\"<\/code><code>..random<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>else<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/code><code>url=ngx.var.scheme..<\/code><code>\":\/\/\"<\/code><code>..ngx.var.host..uri..<\/code><code>\"?jskey=\"<\/code><code>..random<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>end<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>local<\/code> <code>jscode=<\/code><code>\"&lt;script&gt;window.location.href='\"<\/code><code>..url..<\/code><code>\"';&lt;\/script&gt;\"<\/code><\/div>\n<div><code>\u00a0\u00a0\u00a0\u00a0<\/code><code>ngx.say(jscode)<\/code><\/div>\n<div><code>end<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>lua\u4ee3\u7801\u90e8\u5206\u89e3\u91ca\uff1a<br \/>\n1\u30011-12\u884c\u662f\u9650\u901f\u529f\u80fd\u5b9e\u73b0\uff0c\u7b2c5\u548c\u7b2c10\u884c\u8868\u793a10\u79d2\u949f\u5185\u5bb9\u6700\u591a\u53ea\u80fd\u8bf7\u6c4220\u6b21\u3002<br \/>\n2\u300114-48\u884c\u662f\u9a8c\u8bc1\u90e8\u5206\uff0c24\u884c\u4e2d\u76843600\u8868\u793a\u9a8c\u8bc1\u901a\u8fc7\u540e\uff0c\u767d\u540d\u5355\u65f6\u95f4\u4e3a3600\u79d2\uff0c\u53731\u5c0f\u65f6\u3002<\/p>\n<p>update: 2013.5.26<br \/>\n1\u3001\u4fee\u590dJS\u65e0\u9650\u8df3\u8f6cbug<br \/>\n2\u3001\u589e\u52a0\u968f\u673a\u79cd\u5b50<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u4f7f\u7528openresty\u6765\u5b9e\u73b0\u9632cc\u653b\u51fb\u7684\u529f\u80fd\u3002openresty\u5b98\u7f51http:\/\/openresty.\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.shuran.cn\/?p=374\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-374","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=374"}],"version-history":[{"count":1,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":375,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions\/375"}],"wp:attachment":[{"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuran.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}