vue3 nginx反向代理实现生产环境跨域

修改nginx.conf

        listen       8089;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   vuetestdist; 
            index  index.html index.htm;
        }

         location /api{
            proxy_pass  http://xxx.xxx.xxx.xxx.com/;    #需要代理的IP地址
         }
原文地址:https://www.cnblogs.com/czly/p/14540572.html