Nginx配置

# 项目打包
pnpm run build:prod

# 上传文件至远程服务器
将打包生成在 `dist` 目录下的文件拷贝至 `/usr/share/nginx/html` 目录

# nginx.cofig 配置
server {
  listen 80;
  server_name localhost;
  location / {
     root /usr/share/nginx/html;
     index index.html index.htm;
 }
  # 反向代理配置
  location /prod-api/ {
     proxy_pass http://vapi.youlai.tech/; # vapi.youlai.tech替换成你的后端API地址
  }
}

posted @ 2024-05-20 21:34  热心市民~菜先生  阅读(3)  评论(0编辑  收藏  举报