Nginx教程

nginx 跨域

本文主要是介绍nginx 跨域,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
if ($request_method = 'GET') {
                add_header 'Access-Control-Allow-Origin' 'http://localhost:8989';
                add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
                add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
                add_header 'Access-Control-Allow-Credentials' 'true';
            }
这篇关于nginx 跨域的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!