天道酬勤,学无止境

跨域测试

浏览器跨域测试

一:前端浏览器禁用安全设置chrome的话可以通过在命令行,输入chrome.exe --allow-file-access-from-files --user-data-dir="C:/Chrome dev session" --disable-web-security二:http服务器设置: nginx的设置:location /api { add_header Access-Control-Allow-Origin $http_origin;# add_header Access-Control-Allow-Origin *;add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Methods *; add_header Access-Control-Allow-Headers $http_access_control_request_headers; add_header Access-Control-Max-Age 3600; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy

2021-03-27 08:04:15    分类:博客    跨域问题   浏览器   跨域测试   java