So thanks to help on this forum I was able to redirect response and control them using proxy_pass and access_by_lua directives:
location = /access-test {
access_by_lua_block {
return
}
proxy_pass https://www.google.com/;
}
but this denies access:
location = /access-test {
access_by_lua_block {
ngx.exit( ngx.HTTP_FORBIDDEN )
}
proxy_pass https://www.google.com/;
}
Now I wanted to intercept what the proxy_pass server responds and add some HTML to that response and then send it back to the user. How can I do that in this scheme?
Thanks,
Milind