复制
收藏
提问
全网

server { listen 80; server_name www.zhishixun.com www.nneye.cn; client_max_body_size 50m; location / { root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api/ { proxy_pass http://iflip/; # 转发到后端服务 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS,HEAD'; add_header 'Access-Control-Allow-Headers' '*'; add_header 'Access-Control-Expose-Headers' '*'; } } 使用 域名 www.nneye.cn 访问,接口调用www.zhishixun.com/api 出现跨域怎么解决

yangbaby
2个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题server { listen 80; server_name www.zhishixun.com www.nneye.cn; client_max_body_size 50m; location / { root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api/ { proxy_pass http://iflip/; # 转发到后端服务 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS,HEAD'; add_header 'Access-Control-Allow-Headers' '*'; add_header 'Access-Control-Expose-Headers' '*'; } } 使用 域名 www.nneye.cn 访问,接口调用www.zhishixun.com/api 出现跨域怎么解决

已完成理解server { listen 80; server_name www.zhishixun.com www.nneye.cn; client_max_body_size 50m; location / { root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api/ { proxy_pass http://iflip/; # 转发到后端服务 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS,HEAD'; add_header 'Access-Control-Allow-Headers' '*'; add_header 'Access-Control-Expose-Headers' '*'; } } 使用 域名 www.nneye.cn 访问,接口调用www.zhishixun.com/api 出现跨域怎么解决

展开阅读网页

更专业一些
转笔记
专业
server { listen 80; server_name www.zhishixun.com www.nneye.cn; client_max_body_size 50m; location / { root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api/ { proxy_pass http://iflip/; # 转发到后端服务 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS,HEAD'; add_header 'Access-Control-Allow-Headers' '*'; add_header 'Access-Control-Expose-Headers' '*'; } } 使用 域名 www.nneye.cn 访问,接口调用www.zhishixun.com/api 出现跨域怎么解决
不在提醒

更专业内容正在努力生成中
知识树
server { listen 80; server_name www.zhishixun.com www.nneye.cn; client_max_body_size 50m; location / { root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api/ { proxy_pass http://iflip/; # 转发到后端服务 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS,HEAD'; add_header 'Access-Control-Allow-Headers' '*'; add_header 'Access-Control-Expose-Headers' '*'; } } 使用 域名 www.nneye.cn 访问,接口调用www.zhishixun.com/api 出现跨域怎么解决
如何配置Nginx以支持CORS?
跨域问题在前端如何处理?
什么是同源策略?

以上内容由AI搜集生成,仅供参考

在线客服