1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

ngx lua

Discussion in 'Nginx' started by rfocus, Apr 9, 2015.

  1. #1
    Hello, can somebody help me with lua code ?

    Here is a code :
    location /02{
    more_set_headers 'Content-Type: application/octet-stream';
    auth_basic "Enter your login details !";
    auth_basic_user_file pass.txt;
    set $Kon '';
    rewrite_by_lua '
                local res = ngx.location.capture("/urlcheck")
                ngx.var.Kon = res.body;
    ';
    
    
    if ($Kon = "allow") {
    proxy_pass http://127.0.0.1:9090;
    }
        }
    
    Code (markup):
    Problem is with rewrite or content_by_lua in "if" function not working but when I use set_by_lua is working but I need get capture information and store to $Kon ?

    Any onother way to connect set_by_lua and content_by_lua ( via some share memory ... ?!)

    Regards
     
    rfocus, Apr 9, 2015 IP