Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在Windows计算机上使用nginx部署react应用程序_Reactjs_Windows_Nginx_Nginx Reverse Proxy_Nginx Config - Fatal编程技术网

Reactjs 在Windows计算机上使用nginx部署react应用程序

Reactjs 在Windows计算机上使用nginx部署react应用程序,reactjs,windows,nginx,nginx-reverse-proxy,nginx-config,Reactjs,Windows,Nginx,Nginx Reverse Proxy,Nginx Config,我正在尝试使用nginx在windows机器上部署React应用程序,但控制台上出现502:BAD GATEWAY错误 我在文件夹C:\nginx中安装了nginx 我已在路径C:\nginx\html\AppName index.html文件位于文件夹C:\nginx\html下 我之所以在上面提到的html文件夹中创建一个额外的文件夹AppName,是因为在react codepackage.json中,我们有以下属性“homepage”:“/AppName”, 下面是我在nginx.con

我正在尝试使用nginx在windows机器上部署React应用程序,但控制台上出现502:BAD GATEWAY错误

我在文件夹
C:\nginx
中安装了nginx

我已在路径
C:\nginx\html\AppName

index.html
文件位于文件夹
C:\nginx\html

我之所以在上面提到的
html
文件夹中创建一个额外的文件夹
AppName
,是因为在react code
package.json
中,我们有以下属性
“homepage”:“/AppName”,

下面是我在
nginx.conf
文件中所做的更改

server
  {
    listen 80;
    server_name localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;
    
    root html;
    index index.html index.htm;
    
    location /
    {
      
    }
}
每当我尝试访问
http://localhost
我收到一个
502坏网关错误

请建议需要在
nginx.conf
文件中进行哪些更改才能使其正常工作