Without going into too much detail we have a requirement for the following:
a) Query a simple single column, single row result from mysql.
b) Use this variable as part of a more headers module, add_header directive.
c) If no results returned (eg: row count 0), pattern match the request uri ($request_uri from what I recall?) and use a result from here.
d) Ideally cache this data on the nginx end somewhere so future requests can reuse this data without the mysql overhead. There are about 5 million results, but once cached, they always remain the same.
Has anyone ever used nginx and lua, I'm guessing this would be the best route?
Any other recommended ways to do this?