I'm playing with ngx_http_perl_module; for starters, just logging to error_log and setting headers:
location / {
set $target https://$host$request_uri;
perl ph::handler;
add_header X-debug-message "redirect target: $target" always;
return 302 $target;
}
However, if I have that return 302 in there, the perl module is ignored. Commenting it out makes it work. One of the things I may want the perl module to do is change $target or do something locally before issuing the redirect. The docs don't say when and when not the module is actually called... I'm pretty sure I can do the redirect inside perl, but it would be cleaner to do it this way...
location / {
set $target https://$host$request_uri;
perl ph::handler;
add_header X-debug-message "redirect target: $target" always;
return 302 $target;
}
However, if I have that return 302 in there, the perl module is ignored. Commenting it out makes it work. One of the things I may want the perl module to do is change $target or do something locally before issuing the redirect. The docs don't say when and when not the module is actually called... I'm pretty sure I can do the redirect inside perl, but it would be cleaner to do it this way...