下面是nginx的配置,放入nginx中并在页面添加外网访问路径也就是
xxx.xxx.cn/<Object> 图片路径,但是访问超时了,具体也没报什么错误,麻烦大神解答下
upstream ossproxy{
server oss-cn-shenzhen-internal.aliyuncs.com;
}
server {
listen 80;
server_name xxx.xxx.cn; #外网访问路径
error_page 404 /404.html;
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location ~ {
proxy_pass http://ossproxy;
proxy_redirect off;
proxy_set_header Host xxx.oss-cn-shenzhen-internal.aliyuncs.com;#Host要修改为OSS的域名或OSS控制台绑定的域名,否则OSS无法识别会报错
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}