Welcome! Log In Create A New Profile

Advanced

Using $status in location

Posted by nixon1974 
Using $status in location
February 03, 2015 10:22AM
Hi

i would like to execute some lua code (very simple script) only on status code 200

But the internal value of nginx $status variable is always 000

location / {
root /usr/local/nginx-streaming/html;
set $bar $status;
add_header X-Whomx $bar;
}

Does anyone know how to get correct status code.

BR
Re: Using $status in location
February 03, 2015 12:56PM
rewrite_by_lua '
..........
if v>0 then return ngx.exit(513); end;
';

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready