NGINX How to create a redirect view https://mysite.com/yabloki/$requvest_uri https://yabloki.mysite.com/?

Hello
How to create a redirect view
https://mysite.com/yabloki/$requvest_uri -> https://yabloki.mysite.com/

?

With redirect subdomain to url examples found, and according to yet understand
If not hard please give example using map
Thank you
March 23rd 20 at 18:53
1 answer
March 23rd 20 at 18:55
Solution
1.
location /yabloki/ {
 rewrite ^/yabloki/(.*) http://yabloki.mysite.com/$1 permanent;
 return 403;
}

2.
server {

 listen 80;
 server_name example.com;

 location ~ ^/products/(.*)$ {
 proxy_pass http://catalog.example.com/$1;
}

}

3.
server {
 # ...
 server_name domain.tld www.domain.tld;
 return 301 $scheme://subdomain.domain.tld$request_uri;
}

server {
 server_name subdomain.domain.tld;
 # ...
}

Find more questions by tags Nginx