Home  >  Article  >  Operation and Maintenance  >  How to correctly deploy front-end projects with nginx

How to correctly deploy front-end projects with nginx

王林
王林forward
2020-11-16 15:48:573687browse

How to correctly deploy front-end projects with nginx

Purpose:

nginx deploys and packages the front-end project of dist

(Learning video sharing: php video tutorial)

Related knowledge:

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

SEO

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

After installing nginx, configure

The file is placed in /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;
    }
}
rrree

Related recommendations: nginx tutorial

The above is the detailed content of How to correctly deploy front-end projects with nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete