码迷,mamicode.com
首页 > 其他好文 > 详细

nginx 部署单页应用并启用Gzip

时间:2018-10-16 10:58:29      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:httpd   local   clu   access   mat   evel   XML   byte   buffer   

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]\.";

server {
listen 80;
server_name localhost;
#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root D:/nginx/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

nginx 部署单页应用并启用Gzip

标签:httpd   local   clu   access   mat   evel   XML   byte   buffer   

原文地址:https://www.cnblogs.com/WarrenLee/p/9796510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!