server {
    listen 80;
    #server_name localhost;

    #charset koi8-r;
    access_log  /var/log/nginx/host.access.log  main;
    error_log  /var/log/nginx/error.log  error;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm index.html.gz;
        try_files $uri $uri/ /index.html index.html.gz;
    }

    location /api/ {
        proxy_pass http://10.0.8.8:8040/;
    }

    location /static/doc {
      charset "utf-8";
      alias "/doc";
      index index.html index.htm;
      autoindex off;
      autoindex_exact_size on;
      autoindex_localtime on;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
    #开启gzip功能
    gzip on;
    #开启gzip静态压缩功能
    gzip_static on;
    #gzip缓存大小
    gzip_buffers 4 16k;
    #gzip http版本
    gzip_http_version 1.1;
    #gzip 压缩级别 1-10
    gzip_comp_level 5;
    #gzip 压缩类型
    gzip_types text/plain application/javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
    # 是否在http header中添加Vary: Accept-Encoding;
    gzip_vary on;
}
