745   Nginx Reactjs


    # 压缩静态文件
    gzip on;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_comp_level 2;
    gzip_types application/javascript text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
    gzip_vary off;
    gzip_disable "MSIE [1-6]\.";

    # 静态文件
    location ~* .(js) {
        root         /usr/share/www/static;
        try_files $uri /bundle.js;
    }
    # 默认首页
    location / {

        root         /usr/share/www/html;

        try_files $uri /index.html;

    }



Leave a Reply

Your email address will not be published. Required fields are marked *