标签:agent stat work bin file stream load form 开启
打开nginx目录,一般是(/usr/local/nginx)
npm run build 打好vue包 一般放到(/usr/local/nginx/html/)目录下
打开(/usr/local/nginx/conf)目录
server {
listen 80; //映射出的端口
server_name abc.com; //访问的域名或ip(默认是localhost,有时会被占用,是不是随便输个域名都可以?待验证)
location / {
root /usr/local/nginx/html/prod_dist; //放代码的路径(index.html的根目录)
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
//标记二:开启压缩静态资源
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
include api.conf;
include xxx.conf; //标记一,引入server配置
进入 /usr/local/nginx/sbin
命令行:./nginx -s reload
完成:访问abc.com
https://blog.csdn.net/qq_35620501/article/details/89408581 资源压缩
标签:agent stat work bin file stream load form 开启
原文地址:https://www.cnblogs.com/nogodie/p/12071012.html