将vue发布到docker中

一,在docker中如何配置nginx 

参考链接:https://blog.csdn.net/weixin_40461281/article/details/92586378

非常感谢这篇文章!写的非常详细!!!!!!

二,修改nginx的配置

server{
       listen 80;
       charset utf-8;
       server_name xxxxxxxx;
       location / {
           root /usr/share/nginx/html;   #前端地址 
           index  index.html index.htm;
       }
    
       location /api{#遇到API接口会转发到后端接口
           proxy_pass http://xxxxxxxxx:xxxx;  #后端接口
       }
    }

三,将前端配置接口改为80,如图:

 

posted @ 2022-02-13 18:03  Ambition丿z  阅读(64)  评论(0)    收藏  举报