![](/img/trans.png)
[英]nginx + react static build path can't be accessed on direct url hit
[英]Can't open the react build with nginx
我嘗試使用 Nginx 打開反應應用程序。 但是有一個我無法解決的錯誤。 這是我的腳本:
server {
listen 2864;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root "C:\react-app\build";
index index.html;
try_files $uri $uri/ /index.html =404;
}
location /api{
proxy_pass http://localhost:5000;
}
我有這個錯誤:
2021/05/25 09:28:56 [crit] 13908#13176: *7 GetFileAttributesEx() "C:
eact-app\build/index.html" failed (123: The filename, directory name, or volume label syntax is incorrect), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost:2864"
我該如何解決?
Windows-Paths 的語法應該是
C:\\react-app\\build
或更好C:/react-app/build
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.