Nginx跨域解决

location ^~ /haiyoushei {
      set $aa aa.bb.com;
      proxy_set_header Host $aa;
      add_header Access-Control-Allow-Origin *;
      if ($request_uri ~ /haiyoushei/(.+)){
        set $url $1;
      }
      proxy_pass http://$aa/$url;
}

你可能感兴趣的:(nginx,运维)