Доброго дня.
Имеется настроенный конфиг NGINX
server {
listen 80;
server_name my-site.ru;
#access_log /var/log/nginx/access.log;
location ~* \.(jpg|jpeg|gif|png|ico)$ {
root /var/www/respo.my-site/admin/;
index index.html index.php;
#access_log off;
expires 30d;
}
location ~ /\.ht {
deny all;
}
location / {
root /var/www/snd1-mb/;
proxy_pass http://127.0.0.1:81/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_set_header Host $host;
proxy_connect_timeout 60;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_redirect off;
proxy_set_header Connection close;
proxy_pass_header Content-Type;
proxy_pass_header Content-Disposition;
proxy_pass_header Content-Length;
}
}
Типа
if(server_name == (.+).my-site.ru){
return ( или rewrite) 301 http://my-site.ru$request_uri;
}