跨站访问

Nginx 跨站访问

 

 

 

对于浏览器来说一般默认是禁止的

 

为什么浏览器进制跨域访问

不安全,容易出现CSRF攻击

Nginx 跨站访问

 

 

Ngin怎么做

syntax:  add_header name value[always];
default:  -
context:  http,server,location,if in location

Access-Control-Allow-Origin

主要在配置文件中进行配置
add_header Access-Control-Allow-Origin http://www.xxx.com;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2021-11-27
  • 2022-12-23
  • 2021-11-01
猜你喜欢
  • 2021-09-09
  • 2021-08-01
  • 2022-12-23
  • 2021-08-13
  • 2021-06-12
  • 2022-02-23
  • 2022-12-23
相关资源
相似解决方案