簡體   English   中英

無法使用 nginx 打開反應構建

[英]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

http://nginx.org/en/docs/windows.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM