Home  >  Q&A  >  body text

javascript - calling api after npm run build returns index.html

After the vue project is packaged, static and index.html are generated, and then nginx is configured to point to index.html. When calling the api, the content of index.html is returned.

Such a problem will not occur during development. The proxyTable forwarding API is configured in Vue to port 3000. Does nginx also need to configure the forwarding API?

阿神阿神2597 days ago633

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 17:09:25

    你nginxlocation配置有问题咯

    
    location / {
       
            index index.html; 
        }

    reply
    0
  • Cancelreply