T
T
Timokins2019-02-14 22:46:44
Nginx
Timokins, 2019-02-14 22:46:44

How to build a multilingual website with nginx and node.js?

Actually, the question is not how to change the language back and forth,
but
1. how to determine the user's language and correctly give the page,
2. how to feed all this to search engines
, are there any best practice solutions?
should i do it on nodejs or nginx?
perhaps there are some articles...
now I'm at the stage of simply reading Accept-Language and setting the language by this parameter,
but I doubt it...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2019-02-14
@Casufi

I would do it according to Accept-Language, because it is this setting that is available to the user in the browser, plus I would definitely give it a choice and install it in a cookie or in a profile.

R
Roman Mirilaczvili, 2019-02-15
@2ord

First, about the multilingual site

should i do it on nodejs or nginx?
nginx complements nodejs, not replaces it.
nginx is about serving static content or about transferring content from another process, for example, nodejs.
The only time nginx can replace nodejs is if you use the NGINX Unit .
NGINX (which is not a Unit) can take on the task of routing language subdomains like ru-RU.example.com , example.com/ru-RU/ .
The user's browser language preferences are specified in the HTTP header in the Accept-Language and should be parsed to select the most appropriate language candidate in the content output.
How to determine the user's browser language? (JS)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question