Home  >  Q&A  >  body text

nginx - How to proxy the api after the project generated by vue-cli is packaged and sent to the server?

After the vue project is packaged, static and index.html are generated. Originally, the proxyTable was configured as port 3000 during development. How to proxy the api after reaching the server?

The front end and API are packaged together. How to configure the generation environment?

ringa_leeringa_lee2712 days ago672

reply all(3)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 17:09:37

    Can use Nginx

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 17:09:37

    Just let the backend set up CORS

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 17:09:37

    I always feel that your question is very strange. We all know that we use proxyTable as a proxy, that is, we know whether the front-end static page and the server-side API have the same origin after deployment. How can we still have such a problem? It feels like putting the cart before the horse. The answer Don’t you know everything, otherwise how to configure proxyTable

    reply
    0
  • Cancelreply