header_filter_by_lua ' ngx.header.content_length = nil ngx.header.set_cookie = nil if ngx.header.location then local _location = ngx.header.location _location = ngx.escape_uri(_location) _location = "http://10.0.9.44/?_redir_=" .. _location ngx.header.lby vamshi - Nginx Mailing List - English
Sorry for the double post, but wanted to post the complete conf ... just in case there was a mistake server { listen 80; server_name 127.0.0.1 10.0.9.44; set $_ActualTarget ""; location / { rewrite_by_lua ' local _args = ngx.req.get_uri_args() ngx.var._ActualTarget = _args["_urby vamshi - Nginx Mailing List - English
As usual, found my error. The following is properly matcing the regex : local escUri = function (m) local _str = "href=\\"http://10.0.9.44/?_redir_=" _str = _str .. ngx.escape_uri(m[1]) .. "\\"" return _str end local newStr, n, err = ngx.re.gsub(ngby vamshi - Nginx Mailing List - English
Hi, I am trying to modify the response body in the following way : If there href="http://www.google.com", I will convert it to href="http://nginx-ip/?_url_={url-encoded-form-of www.google.com} This is what I have in my nginx.conf location / { .... .... .... body_filter_by_lua ' local escUri = function (m) return "href=\\&qby vamshi - Nginx Mailing List - English
I found the issue(s). I am not sure why the error log did not have any logs after the lua thread got launched. Here is the updated /etc/nginx/nginx.conf location / { set $dbKey ""; content_by_lua ' local a = ngx.var.http_cookie local b = ngx.var.http_my_custom_auth print(a) priby vamshi - Nginx Mailing List - English
My nginx.conf upstream testdb { postgres_server 10.0.9.43:9000 dbname=testdb user=postgres password=postgres; postgres_keepalive max=100 mode=multi overflow=ignore; } location / { set $x ""; content_by_lua ' local a = ngx.var.http_cookie local b = ngx.var.http_my_custom_authby vamshi - Nginx Mailing List - English