server {
listen 8090;
server_name localhost;
location / {
root /Users/xxx/Desktop/localNginxSpace;
autoindex on;
#index index.html index.htm;
}
location /xxx-xxx {
proxy_pass http://xxx.xxx.xxx.xxx:40094/;
#add_header Access-Control-Allow-Methods "POST, GET";
}
}
有个本地的html文件,ajax请求接口,nginx配置如上,访问localhost:8090还是存在跨域问题
前端请求地址: