---
title: "nginx打开跨域cookies授权配置"
author: "yinxvxv"
date: "2016-12-02T14:43:04Z"
tags: []
categories: ["Web前端"]
slug: "nginx-cookies"
draft: false
lastmod: "2016-12-02T14:43:04Z"
id: 2342495
url: "https://yinxvxv.iteye.com/blog/2342495"
---

if ($http\_origin ~* (baidu.com)) {

                add\_header 'Access-Control-Allow-Origin' '$http\_origin';

                add\_header 'Access-Control-Allow-Credentials' 'true';

        }  

 

\*.baidu.com来的请求都开放