[Liunx] Server solves cross-domain problems

First open the backend site

Open the "Configuration File" in the site settings and then add the cross-domain configuration under "server_name local ip ", the addition is successful Then restart nginx

 add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
add_header 'Access-Control-Allow-Credentials' 'true';
  add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

Guess you like

Origin blog.csdn.net/m0_64494670/article/details/134368597