vue打包運行在nginx

1、項目打包,在package.json中查看打包命令

2、運行打包命令

npm run build:prod

3、將打包後的dist文件的複製到nginx/html文件

4、配置conf/nginx.conf

server {
        listen       8089;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location /prod-api/ {
            root D:\nginx-1.17.10\html\dist;
	    proxy_pass  http://localhost:9600/;
            index  index.html index.htm;
			
        }
    }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章