想请教,由于前端项目在本地调试使用了代理转发第三方API,在 EdgeOne中有什么办法解决代理问题,否则生产环境有第三方API会有CORS问题。
类似于实现nginx代理转发的能力:
server {
listen 80;
server_name your-domain.com;
root /path/to/your/project/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
# 代理 API 请求
location /api/dashscope {
proxy_pass https://dashscope.第三方.com;
proxy_set_header Host dashscope.第三方.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
相似问题