Ruby Forum NGINX > How to write a module to redirect a request to specific server by uri?

Posted by nbubingo (Guest)
on 31.08.2008 08:57
(Received via mailing list)
Hello:
I want to write a module to redirect a request to a specific server by 
uri. when received a request, I need to calculate the secific server's 
ip with the number in the uri.
I have tried the function of ngx_http_internal_redirect(), but it seems 
useless to redirect a request to another server. Is there any function 
can do this?
My purpose is similar to the rewrite module with  the directive of 
"permanent " , but I can't quite understand the rewrite module, 
especially the function of ngx_http_rewrite_handler(). Can I just modify 
the some members in the struct of ngx_http_request_t?

thank you fo any help.

2008-08-31



nbubingo
Posted by Anton Yuzhaninov (Guest)
on 31.08.2008 14:33
(Received via mailing list)
On 31.08.2008 10:47, nbubingo wrote:
>  
You can set in module variable, then use it in config

proxy_pass     http://$varibale_set_by_module;

--
  Anton Yuzhaninov

P. S. Don't forget about some auth, to don't make open proxy...