首頁  >  文章  >  運維  >  nginx怎麼正確部署前端項目

nginx怎麼正確部署前端項目

王林
王林轉載
2020-11-16 15:48:573604瀏覽

nginx怎麼正確部署前端項目

目的:

nginx部署打包成為dist的前端專案

(學習影片分享:php影片教學

相關知識:

docker 安装与使用
docker pull nginx
docker run --restart=on-failure:20 -itd --name nginx -p 80:80 nginx:latest

SEO

nginx如何部署dist?
nginx如何部署vue?
nginx如何部署前端项目?

安裝nginx後,設定

該檔案放在/etc/nginx/conf.d/xxx.conf

server{
    listen 80;
    server_name  xxx.com;

    location /{
        root /home/web/vueProjects/wxopapp/dist/;
        index index.htm index.html;
        expires      30d;
    }
}
nginx -t
nginx -s reload

相關推薦:nginx教學

以上是nginx怎麼正確部署前端項目的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:csdn.net。如有侵權,請聯絡admin@php.cn刪除