Because I don't want to use CDN anymore I would like to rewrite cdn.example.com to www.example.com. How to do this with Nginx? There is only www.example.com in my server block.
Asked
Active
Viewed 66 times
1 Answers
0
server {
server_name cdn.example.com;
return 301 $scheme://www.example.com$request_uri;
}
This assumes two things:
- That
cdn.example.com
DNS is pointed at the same placewww.example.com
- That content served from CDN is being hosted on www under the same paths

sesser
- 101
- 1