I want to access nginx $uri variable in perl, the following is my nginx.conf<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><span style="font-family: courier new,monospace;">worker_processes 1;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">events {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> worker_connections 1024;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">http {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> perl_set $perlvar 'sub {return "ngx_uri:$uri";}';</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> server {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> listen 80;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> location / {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> add_header "perlvar" $perlvar;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> empty_gif;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><b><br clear="all"></b></blockquote><br>but it doesn't work, nginx $uri variable is empty in perl, can somebody figure out what the problem is?<br>
<br>Thanks!<br>