Localise error pages?
SplitIce
mat999 at gmail.com
Fri Apr 8 08:09:07 MSD 2011
Very nice Igor! Now I understand why map is so useful.
On Thu, Apr 7, 2011 at 10:25 PM, Igor Sysoev <igor at sysoev.ru> wrote:
> On Thu, Apr 07, 2011 at 01:56:42PM +0300, Pekka.Panula at sofor.fi wrote:
> > Hi
> >
> > Is there any way to localise nginx to give its error pages in different
> > language?
> > I think brower tells in headers what languages it supports, can it
> somehow
> > to use to give localised version of error messages?
>
> In 0.9.6+ you can try
>
> http {
>
> map $http_accept_language $lang {
> default en;
> ~^(?<LNG>fr|fi|zh|ru) $LNG;
> }
>
> server {
> error_page 404 /errors/404.html;
>
> location /errors/ {
> root /path/to/pages/$lang/;
> }
>
> ...
> }
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
--
Warez Scene <http://thewarezscene.org> Free Rapidshare
Downloads<http://www.nexusddl.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110408/45aa81b2/attachment-0001.html>
More information about the nginx
mailing list