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;
}

  

原文地址:https://www.cnblogs.com/sellsa/p/7791666.html