Deploy the front-end project on nginx

1. Install nginx

Reference article:http://t.csdnimg.cn/2Ba40

2. Throw dist to /usr/local/nginx/html

3. Modify nginx.conf

Add the following paragraph:

server {
    listen       8088;
    server_name  admin;
    location / {
         root  /usr/local/nginx/html/;
         index  index.html;
         try_files $uri $uri/ /index.html; # 防止页面刷新404
    }
}

 4. Stop and restart nginx

sudo /usr/local/nginx/sbin/nginx -s stop
sudo /usr/local/nginx/sbin/nginx
ps aux | grep nginx

5. Visit

http://Server IP:8088/admin/dashboard/welcome

Ling: There is no reverse proxy here, but it can also be connected to the backend. I don’t know why at the moment and haven’t found the reason.

If a reverse proxy is added, the configuration is:

6. If you find that you cannot access the entrance page after deployment, please read another articlehttp://t.csdnimg.cn/xdrb9

Guess you like

Origin blog.csdn.net/weixin_51451545/article/details/133688046