Localise error pages?

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?

Terveisin/Regards,
Pekka Panula, Sofor Oy - Jatkuvat palvelut

On Thu, Apr 07, 2011 at 01:56:42PM +0300, [email protected] 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 S.
http://sysoev.ru/en/

Very nice Igor! Now I understand why map is so useful.

On Fri, Apr 08, 2011 at 12:28:41PM +0300, [email protected] wrote:

Hi

I’m running nginx v0.7.x series, is that tip possible on older versions,
like in nginx 0.8.x?

No.

I am just thinking about to update to 0.8.x version.

Please wait until tomorrow.

Subject: Re: Localise error pages?

    error_page  404  /errors/404.html;

Igor S.
http://sysoev.ru/en/


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx


Igor S.
http://sysoev.ru/en/

Hi

I’m running nginx v0.7.x series, is that tip possible on older versions,
like in nginx 0.8.x?
I am just thinking about to update to 0.8.x version.

Terveisin/Regards,
Pekka Panula, Sofor Oy - Jatkuvat palvelut

Igor S. [email protected] wrote on 07.04.2011 15:25:29:

From: Igor S. [email protected]
To: [email protected]
Date: 07.04.2011 15:25
Subject: Re: Localise error pages?

On Thu, Apr 07, 2011 at 01:56:42PM +0300, [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs