Nginx cross-domain if HttpCode is not 200, there will be a problem.

for example, if the title nginx is cross-domain, there will be a problem if the returned HttpCode is not 200

if the requested address HttpCode is 200. there is no problem. If it is not 200, there will be an error that cannot cross domains!
how to set it?

the current setting is:

add_header Access-Control-Allow-Origin  $http_origin;
add_header Access-Control-Allow-Headers "Cookie,Set-Cookie,token,x-requested-with,content-type,withcredentials";
add_header "Access-Control-Allow-Methods" "GET,POST,OPTIONS,DELETE,PUT";
add_header "Access-Control-Allow-Credentials" "true";
Oct.09,2021

not only the server needs to be set up, but the ajax request also needs to be set up
refer to Link description

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38139-2b860.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38139-2b860.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?