因为使用腾讯的cos必须要备案
比较烦琐,有没有办法不备案也使用呢
方法有用nginx反向代理,前提你已经有一个备案的域名
配置如何
>root@ip-172-31-43-182:/etc/nginx/conf.d# cat web.conf
server {
listen 80;
server_name static.test.xyz;
root /usr/share/nginx/html;
index index.php index.html;
access_log /var/log/test.log;
error_log /var/log/test.error.log;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ^~ /
{
proxy_set_header Host static.test.cn;
proxy_pass https://static.test.cn;
}
}
其中`https://static.test.cn`为cos对象存储对应的cdn域名