这就涉及到跨域的问题。 这里我是用Nginx来部署Vue项目的,所以这里直接修改Nginx项目配置文件,先把配置附上 server{listen 80;server_name test.com;index index.html index.htm index.php;root /home/dfs/h5/master;add_header Access-Control-Allow-Methods'GET, POST, OPTIONS';location /{try_files$uri$uri...
index index.html index.htm; }# 代理自己的项目location /cees-client {aliashtml/cees-client; index index.html;# autoindex on;try_files$uri$uri/ /cees-client/index.html;#解决刷新404}# 配置代理vite中的跨域location /client { proxy_pass http://43.136.31.72:7804; } }...
location/datav{alias/www/wwwroot/test.xjaft.com/datav;try_files$uri$uri//datav/index.html;} nginx代理跨域,跨服务器 location /api{ # 接口前缀 proxy_pass https://ahmg.yooticloud.cn; # 目标服务器 proxy_redirect off; # 重定向关 proxy_cookie_path / /api; # 目标服务器接口后缀 }...