nginx跨域配置

2021年07月22日 | 分类: nginx | 评论: 0 | 浏览: 917
		add_header Access-Control-Allow-Origin $http_origin;
		add_header Access-Control-Allow-Methods 'GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS';
		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';

		if ($request_method = 'OPTIONS') {
			return 204;
		}


顶一下 ▲()
踩一下 ▼()
发表留言
登录后才能发表留言,立即 登录注册
提交 (Ctrl+Enter)
Copyright 2020-2024 xaoi博客 All Rights Reserved.