Content negotiation?

Marcus Clyne maccaday at gmail.com
Wed Jul 29 18:47:54 MSD 2009


Hi,

Nuno Magalhães wrote:
>> It should be relatively simple to write module with such
>> capabilities.  And I believe somebody already did this, at least
>> something with name "Accept Language Module" is listed on
>> wiki.nginx.org:
>>
>> http://wiki.nginx.org/NginxAcceptLanguageModule
>>     
Unless the code has been updated recently, there are some bugs with the 
code which would prevent it doing what it's supposed to (though the 
fixes are easy).

A few months ago I wrote a more advanced language-negotiation module 
that checked for a POST variable, a cookie and then the Accept-Language 
header (in that order) for language info, and set a cookie afterwards if 
not already set. 

I'm thinking about adding MIME negotiation too. (e.g. being able to 
switch between gif, png, svg).

I'm working on other stuff right now, but could check that it's working 
and publish it if people are interested.

Any other requests?

Note that you can currently do content negotiation using if (...) 
statements and regexes on $http_ variables - incorporating them into a 
module would probably just speed things up a bit.

Marcus.





More information about the nginx mailing list