🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
跨域提示:access-control-allow-origin 解决办法:用nginx进行转发,可解决跨域问题,加上'Access-Control-Allow-Origin'参数,如下 ```sh cat /etc/nginx/conf.d/file_proxy.conf upstream file { #服务器集群名字 server 192.168.0.131:9999 weight=1 max_fails=0 fail_timeout=20s; } server { listen 29999 ; location / { add_header 'Access-Control-Allow-Origin' '*'; proxy_pass http://file; proxy_redirect default; proxy_set_header Host $host; proxy_set_header 'Access-Control-Allow-Origin' '*'; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } ```