nginx 跨域配置


在conf的service里添加

#允許跨域請求的域,*代表所有
add_ header ' Access-Control-Allow-0rigin' *;
#允許帶上cookie請求
add_ header ' Access-Control-Allow-Credentials' 'true';
#允許請求的方法,比如GET/POST/PUT/DELETE
add_ header ' Access-Control-Allow-Methods' *;
#允許請求的header
add_ header ' Access-Control-Allow-Headers' *;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM