美文网首页
nginx部署不同react 项目相同域名

nginx部署不同react 项目相同域名

作者: 左洁 | 来源:发表于2023-05-14 16:33 被阅读0次

    1:react 创建项目链接

    https://create-react-app.dev/docs/getting-started

    2:运行项目命定

    npm start

    3:项目配置

    增加homepage配置http://domain/test

    image-20230515162501779.png

    4:nginx配置

    react项目1部署到路径/var/www/test1

    react项目2部署到路径 /var/www/test2

       server {
       listen 443 ssl default_server;
     
        server_name  xxxx.com;
     
     root /var/www/test1;
     
        index index.html index.htm index.nginx-debian.html;
    
        server_name xxx.com; 
     
     
     location /test {
       
          alias /var/www/test2;
        }
        
        }
    

    相关文章

      网友评论

          本文标题:nginx部署不同react 项目相同域名

          本文链接:https://www.haomeiwen.com/subject/yxupsdtx.html