I'm sure what I'm wanting to do is possible with nginx, but it's isn't clear to me how to achieve it. I'd like for nginx to be able to receive a browser request that is handed to a C module I will code that will alter the URI (based on values returned by a MySQL database). Then I would like the standard proxying abilities of nginx be used to proxy the content from a private BE to the client based on the altered URI.
My thinking is I need to use a C module for the URI rewrite since I need to alter it based on data from a database. It isn't obvious to me how to code this. I've been using ngx_http_rewrite_module.c as a guild, but there's a lot going on in the code. Is a simpler example available I might reference?
Also, the only URIs I'd like nginx to proxy are ones returned by the C module. I'd never want a URI submitted by a client to be proxied directly.
Any suggestions are appreciated!