D
D
Dilik Pulatov2019-12-03 14:13:58
Nginx
Dilik Pulatov, 2019-12-03 14:13:58

How to add language code to url in Nginx?

Hello!
The site is powered by Vue js(NuxtJS) in SSR mode.
The site is launched on port 3000 and through the proxies in Nginx I will listen to the port for the domain.
The site is multi-language. example url now site.com/en
So the task is this.
In Nginx, you need to implement it so that when you click on a link, for example: site.comyou need to redirect to, en.site.comthat is, the language code must be before the domain.
How can this be implemented?
And at the same time, you need validation for the language code .... let's say I have 2 languages ​​RU and EN . You need Nginx to skip only these: en.site.comandru.site.com

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2019-12-03
@firedragon

Try it.
https://github.com/giom/nginx_accept_language_module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question