Skip to content

Using Resty HTTP library

Conor McKnight edited this page Sep 3, 2025 · 4 revisions

The script will work without the need for any external libraries but i did build in the option to use them if you like.

To use the resty http library all you need to do is edit your nginx config to include this in your http block http {

lua_package_path "./conf/lua/lua-resty-http-master/lib/?.lua;;";

Then inside the script you can set the resty http boolean to true, --true to use lua resty.http library if exist.

if you set this to true you can change localized.content_cache = { ngx.var.request_uri, to "https://www.google.com/", as an example. If your proxying and grabbing external websites.

Clone this wiki locally