Custom Error pages

Alex Samad alex at samad.com.au
Fri Mar 24 05:53:55 UTC 2017


Hi

I got something like this

    error_page   404 /stderror404.html;

    location = /stderror400.html {
        root   /var/www/error;
        content_by_lua_file /var/www/error/stderror400.lua;

        internal;
        allow all;
    }


and the lua file has

ngx.say( "Your source ip address is: " .. ngx.var.remote_addr .. ":" ..
ngx.var.remote_port .. "<br>");
ngx.say( "You requested URI: " .. ngx.var.uri .. "<br>");


Question

Seems like I have to do a restart to get the lua file reread if I have
changed it ... reload doesn't seem to cut it. is there some signal i can
send to reread the lua file.

ngx.var.uri is always /stderror404.html  how can I capture the original uri
and print it here ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170324/30a52b98/attachment.html>


More information about the nginx mailing list