栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

vue打包

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vue打包

1、修改vue.config.js
publicPath: ‘/’,改为 publicPath: ‘./’,

2、 outputDir: ‘dist’,改为 outputDir: ‘dist/html’,

3、nginx配置文件

#load_module /app/servers/nginx/modules/ngx_stream_module.so;
#user mwop mwop;

	worker_processes 2;

	error_log logs/error.log;

	pid logs/nginx.pid;

	worker_rlimit_nofile 65535;

	events {
		use epoll;
		worker_connections 10240;
		}			

	http {
		include mime.types;
		default_type application/octet-stream;
		server_tokens off;
		gzip on;
		gzip_min_length 1k;
		gzip_buffers 16 8k;
		gzip_http_version 1.1;
		gzip_comp_level 2;
		gzip_types text/css text/xml application/javascript application/atom+xml application/rss+xml text/plain application/json application/x-javascript application/xml text/javascript;
		gzip_disable "MSIE [1-6].";
		gzip_vary on;
		client_max_body_size 100m;
		proxy_http_version 1.1;
		proxy_buffering on;
		proxy_buffer_size 4k; 
		proxy_buffers 8 1M;
		proxy_busy_buffers_size 2M;
		rewrite_log on;

		log_format access '$remote_addr:$remote_port - $server_addr:$server_port $remote_user [$time_local] "$request" '
		'$status $body_bytes_sent "$http_referer" '
		'"$http_user_agent" "$http_x_forwarded_for" '
		'$request_length $msec $connection $upstream_addr '
		'$upstream_response_time $request_time "$http_cookie"';

		access_log logs/access.log access;

		sendfile on;
		keepalive_timeout 65;
		

		upstream admin {
     			ip_hash;
        		server 10.104.10.36:8081;
   			 }

		server {
	#		listen 0.0.0.0:8080;
			listen 80;
			server_name 10.136.1.11x;


		location /budget/admin/html {
			alias /app/budget/web/dist/html;
			index index.html index.htm;
			}			

		location /nginx_status {
			stub_status on;
			access_log off;
			allow 127.0.0.1;
			allow 10.0.0.0/8;
			allow 100.0.0.0/8;
			allow 10.0.0.0/24;
			deny all;
			}		

		location /base {
			proxy_pass http://admin;
			proxy_redirect off;
			proxy_set_header Host $http_host;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_set_header X-Forwarded-Proto $scheme;
			}	
	}
}

更多技术文章请关注公众号:架构师Plus,
扫码添加

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/268723.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号