I have to redirect www.example.com/docs/....pdf to trader.example.com/docs/....pdf on an existing Project. The same applies to *.biz. I have no Idea how can i extract the wwww-Part from $host-Variable.
server {
listen 80;
server_name www.example.com www.example.biz;
location /docs {
root /data/http/example/docs;
rewrite ^ $scheme://trader.$host$request_uri;
}
}
Does anyone have any idea how I can solve this?