Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up an nginx - apache reverse proxy where nginx handles the static files and apache the dynamic. I have a search engine and depending on search parameter I either directly forward the user to the page they are looking for or provide a set of search results.

I cache these results in memcached as

key:/search.cgi?q=foo
value: LOCATION:http://www.example.com/foo.html

and

key:/search.cgi?q=bar
value: CONTENT-TYPE: text/html

<html>
....
....
</html>

I can pull the "Content-type...." values out of memcached using nginx and send them to the user, but I can't quite figure out how to handle a returned value like "Location..."

Can I?

share|improve this question

1 Answer 1

From what I can tell, the nginx memcached module can only store the raw contents of the request, be it a gif, html, whatever. It would be unable to interpret your LOCATION parameter without hacking the module up. (Not recommended)

To use nginx in this manner you would have to use memcached to store the actual html content of the page specified by the LOCATION field, and store that in your memcached instead, or use a set of redirects in another manner.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.