githubxubin opened a new issue, #8710:
URL: https://github.com/apache/apisix/issues/8710

   ### Description
   
   1.新建路由 开启cors 插件
   `{
     "uri": "/cor/*",
     "name": "test",
     "desc": "test",
     "methods": [
       "GET",
       "POST",
       "PUT",
       "DELETE",
       "PATCH",
       "HEAD",
       "OPTIONS",
       "CONNECT",
       "TRACE"
     ],
     "plugins": {
       "cors": {
         "allow_credential": false,
         "allow_headers": "*",
         "allow_methods": "*",
         "allow_origins": "*",
         "disable": false,
         "expose_headers": "*",
         "max_age": 5
       },
       "proxy-rewrite": {
         "regex_uri": [
           "^/cor(/|$)(.*)",
           "/$2"
         ]
       }
     },
     "upstream": {
       "nodes": [
         {
           "host": "192.168.85.66",
           "port": 8001,
           "weight": 1
         }
       ],
       "timeout": {
         "connect": 6,
         "send": 6,
         "read": 6
       },
       "type": "roundrobin",
       "scheme": "http",
       "pass_host": "pass",
       "keepalive_pool": {
         "idle_timeout": 60,
         "requests": 1000,
         "size": 320
       }
     },
     "labels": {
       "API_VERSION": "v1.0"
     },
     "status": 1
   }`
   
   
   2.前后端分离项目,直接调用路由地址,google 浏览器 报跨域错误
   
![image](https://user-images.githubusercontent.com/39228009/213348858-40190bff-719f-4b95-a294-fe7393e95e3a.png)
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to