When Qiniu Cloud CDN creates a new domain name, Qiniu Cloud requires origin site testing. The form is as shown below:
I am sure that this image path is OK, because during the subsequent communication with Qiniu Cloud customer service, he told me that "your server does not allow the host to access the accelerated domain name request and returns 404", as shown below:
$ curl -I "http://www.dgcomet-cms.dgcomet.com/static/img/6bb80da2c2d4045f7173d41 305709832.jpg" -H "Host:cn.dgcomet-cms.dgcomet.com"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HT TP/1.1 404 Not Found
Date: Wed, 24 May 2017 10:28:05 GMT
Server: Apache/2.4.23 (Unix) PHP/5.6.8
Content-Type: text/html; charset=iso-8859-1
If you do not bring this Host, it is normal:
$ curl -I "http://www.dgcomet-cms.dgcomet.com/static/img/6bb80da2c2d4045f7173d41 305709832.jpg"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 82935 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0HT TP/1.1 200 OK
Date: Wed, 24 May 2017 10:27:42 GMT
Server: Apache/2.4.23 (Unix) PHP/5.6.8
Last-Modified: Wed, 24 May 2017 07:51:25 GMT
ETag: "143f7-550405ef9e6a0"
Accept-Ranges: bytes
Content-Length: 82935
Content-Type: image/jpeg
My server is Alibaba Cloud ECS, using apache. How can I configure it so that the request with Host:cn.dgcomet-cms.dgcomet.com
can pass?
Well, I found a method and it turns out to be very simple.
I was already using apache’s vhost. I added the acceleration domain name to the ServerAliasunder the vhost corresponding to the origin domain name and it was OK