For example, the following locations cause LocalJumpError at their return statements and return 500 Internal Server Error.
location /enable_return_from_block {
mruby_rewrite_handler_code '
[0].each do |_|
r = Nginx::Request.new
r.headers_out["Location"] = "http://example.com"
Nginx.return Nginx::HTTP_MOVED_TEMPORARILY
return
end
';
}
location /enable_return_from_for_statement {
mruby_rewrite_handler_code '
for _ in [0]
r = Nginx::Request.new
r.headers_out["Location"] = "http://example.com"
Nginx.return Nginx::HTTP_MOVED_TEMPORARILY
return
end
';
}
Please check my test results, too: a2ikm#2