我在让我的 React 应用程序在远程服务器上运行时遇到问题。我有 Nginx 设置如下confserver { listen 80; listen [::]:80; server_name xxx.xxx.x.x; root /var/www/my-site; index index.html; gzip on; gzip_comp_level 3; gzip_types text/plain text/css application/javascript image/*;}为了确认 Nginx 的工作原理,我输入了一个index.html,/var/www/my-site它确实有效并且没有问题。然后我cd从/var/www/my-sitegit 克隆反应项目。然后我跑npm run build。我不确定接下来要做什么。我试过了serve -s build,我得到:ERROR: Cannot copy to clipboard: write EPIPE ┌──────────────────────────────────────────────────┐ │ │ │ Serving! │ │ │ │ - Local: http://localhost:5000 │ │ - On Your Network: http://xxx.xxx.xx.x:5000 │ │ │ └──────────────────────────────────────────────────┘但是,当我将浏览器指向服务器地址时,我什么也得不到(我删除了原始的 index.html)。我在这里做错了什么?
添加回答
举报
0/150
提交
取消