在server域中加入以下配置:

#解决跨域问题
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Headers Origin,X-Requested-With,Content-Type,Accept,x-language;
add_header Access-Control-Allow-Methods POST,GET,OPTIONSZ,PUT,DELETE;

重启nginx即可.

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2021-10-03
  • 2022-02-14
猜你喜欢
  • 2021-12-04
  • 2023-04-11
  • 2022-12-23
  • 2021-12-19
  • 2021-10-18
  • 2021-06-07
相关资源
相似解决方案