nginx实现动静分离

upstream java_api {
    server 127.0.0.1:8080;
}

server {
    listen  80;
    server_name  www.heboan.com;

    access_log /var/log/nginx/log/www_heboan_com.access.log
    root /opt/app/code;

    location ~ \.jsp$ {
        proxy_pass  http://java_api;
        index  index.html index.htn;
    }

    location ~ \.(jpg|png|gif)$ {
        expires 1h;
        gzip on;
    }

    error_page  500 502 503 504 404 /50x.html;
}

  

posted @ 2017-11-06 09:25  sellsa  阅读(223)  评论(0编辑  收藏  举报