![使用反向代理部署时,React js 不提供静态文件](https://linux22.com/image/753796/%E4%BD%BF%E7%94%A8%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86%E9%83%A8%E7%BD%B2%E6%97%B6%EF%BC%8CReact%20js%20%E4%B8%8D%E6%8F%90%E4%BE%9B%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6.png)
有一个 ReactJS 应用程序在 Nginx 下完美运行。要求是在另一个网站下运行此应用程序,使用反向代理。 我的nginx 配置说:
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-Proto $scheme;
add_header Access-Control-Allow-Origin website-2;
add_header Access-Control-Expose-Headers Content-Length;
add_header Access-Control-Allow-Headers Range;
}
但是当我尝试使用访问它时网站-2/应用程序它给出了一个错误:
Loading failed for the <script> with source “website2/static/js/2.2c5e110e.chunk.js”
知道我遗漏了什么吗?
谢谢