Answer the question
In order to leave comments, you need to log in
How to redirect from subdomain to NGINX folder?
It is necessary that when accessing test.site.com, it is redirected to site.com/test and so on for all subdomains.
That is abc.site.com -> site.com/abc
xyz.site.com -> site.com/xyz
How to implement on nginx ?
Answer the question
In order to leave comments, you need to log in
server{
server_name *.sss.local sss.local;
if ($host ~* ^([a-z\.]+)\.sss.local$) {
return 301 http://sss.local/$1$request_uri;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question