search

Home  >  Q&A  >  body text

Flask+vue+webpack uses nginx+uwsgi deployment problem

Question: The system was developed using flask+vue and now needs to be deployed on VPS. Now deployed on VPS using nginx+uwsgi, the page can now be accessed through the domain name, but because css, js, and the page are all written in vue. Vue is packaged using webpack.

In the configuration of webpack, publicPath = process.env.PUBLIC_PATH || 'http://IP:5001/assets/'

But when accessing, the packaged js and css cannot be loaded, and the page cannot be displayed.

Firebug shows http://IP:5001/assets/*.js abort. Unable to load.

The simple configuration of nginx just transfers port 80 to port 8001.

How to configure webpack or nginx to expose js css

为情所困为情所困2751 days ago1235

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 17:18:01

    My experience is to use nginx js and css to access your physical path, such as root /static/ /home/xxx/static

    reply
    0
  • Cancelreply