Welcome! Log In Create A New Profile

Advanced

Re: Localise error pages?

SplitIce
April 08, 2011 12:10AM
Very nice Igor! Now I understand why map is so useful.

On Thu, Apr 7, 2011 at 10:25 PM, Igor Sysoev <igor@sysoev.ru> wrote:

> On Thu, Apr 07, 2011 at 01:56:42PM +0300, Pekka.Panula@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@nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



--
Warez Scene http://thewarezscene.org Free Rapidshare
Downloadshttp://www.nexusddl.com
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Localise error pages?

Anonymous User April 07, 2011 06:58AM

Re: Localise error pages?

Igor Sysoev April 07, 2011 08:26AM

Re: Localise error pages?

SplitIce April 08, 2011 12:10AM

Re: Localise error pages?

Anonymous User April 08, 2011 05:30AM

Re: Localise error pages?

Igor Sysoev April 11, 2011 05:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready