S
S
SteepNET2022-02-18 15:27:56
Nginx
SteepNET, 2022-02-18 15:27:56

Redirect from subdomain page to nginx domain page?

Good afternoon!
I can’t find an example of solving my problem anywhere...
I need to redirect to the domain page from a certain page of all subdomains...

if ($host = 'https://*.test.ru/test' ) {
    rewrite ^/(.*)$ https://test.ru/test permanent;
}


That doesn't work..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2022-02-18
@SteepNET

If you have one config for all subdomains, then just add it location = /test { }with the necessary processing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question